> For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt.

# getCodegenTransformRules

A helper function that returns `module.rules` configuration for handling React Native codegen transformation, which is required for projects using [New Architecture](https://reactnative.dev/architecture/landing-page).

:::info
This helper function is a part of [`getJsTransformRules`](/api/utils/get-js-transform-rules.md).
:::

:::warning
This helper function is only relevant when using Rspack as your bundler. If you are using webpack with `babel`, you don't need to use this helper function, since it's already included as part of `@react-native/babel-preset`.
:::

## Example

```js title=rspack.config.cjs
const Repack = require("@callstack/repack");

module.exports = {
  module: {
    rules: [...Repack.getCodegenTransformRules()],
  },
};
```
