Skip to content

Commit 3ac8b2f

Browse files
annityaHenning Kvinnesland
authored andcommitted
feat(react): allow all react-compiler options
1 parent 0389922 commit 3ac8b2f

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

packages/plugin-react/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,8 @@ The `reactCompilerPreset` accepts an optional options object with the following
107107
- `compilationMode` — Set to `'annotation'` to only compile components annotated with `"use memo"`.
108108
- `target` — Set to `'17'` or `'18'` to target older React versions (uses `react-compiler-runtime` instead of `react/compiler-runtime`).
109109

110+
Additional options can be found in the [documentation](https://react.dev/reference/react-compiler/configuration).
111+
110112
```js
111113
babel({
112114
presets: [reactCompilerPreset({ compilationMode: 'annotation' })],

packages/plugin-react/src/reactCompilerPreset.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,7 @@ import type {
44
} from '#optionalTypes'
55

66
export const reactCompilerPreset = (
7-
options: Pick<
8-
ReactCompilerBabelPluginOptions,
9-
'compilationMode' | 'target'
10-
> = {},
7+
options: ReactCompilerBabelPluginOptions = {},
118
): RolldownBabelPreset => ({
129
preset: () => ({
1310
plugins: [['babel-plugin-react-compiler', options]],

0 commit comments

Comments
 (0)