Skip to content

Commit 63cf1bc

Browse files
committed
docs(en): merging all conflicts
2 parents c95e4c6 + 47e64bf commit 63cf1bc

2 files changed

Lines changed: 37 additions & 11 deletions

File tree

src/content/learn/react-compiler/installation.md

Lines changed: 36 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,36 @@ module.exports = {
6464

6565
### Vite {/*vite*/}
6666

67+
<<<<<<< HEAD
6768
如果你使用 Vite,可以将插件添加到 vite-plugin-react 中:
69+
=======
70+
If you use Vite with version 6.0.0 or later of `@vitejs/plugin-react`, you can use the `reactCompilerPreset`:
71+
>>>>>>> 47e64bf7ad81aab8bacfa791a37816ee869135eb
6872
69-
```js {3,9}
73+
<TerminalBlock>
74+
npm install -D @rolldown/plugin-babel
75+
</TerminalBlock>
76+
77+
```js {3-4,9-11}
78+
// vite.config.js
79+
import { defineConfig } from 'vite';
80+
import react, { reactCompilerPreset } from '@vitejs/plugin-react';
81+
import babel from '@rolldown/plugin-babel';
82+
83+
export default defineConfig({
84+
plugins: [
85+
react(),
86+
babel({
87+
presets: [reactCompilerPreset()]
88+
}),
89+
],
90+
});
91+
```
92+
93+
<Note>
94+
In `@vitejs/plugin-react@6.0.0`, the inline Babel option was removed. If you're using an older version, you can use:
95+
96+
```js
7097
// vite.config.js
7198
import { defineConfig } from 'vite';
7299
import react from '@vitejs/plugin-react';
@@ -81,26 +108,25 @@ export default defineConfig({
81108
],
82109
});
83110
```
111+
</Note>
84112

113+
<<<<<<< HEAD
85114
或者,如果你更倾向于为 Vite 使用一个独立的 Babel 插件:
115+
=======
116+
Alternatively, you can use the Babel plugin directly with `@rolldown/plugin-babel`:
117+
>>>>>>> 47e64bf7ad81aab8bacfa791a37816ee869135eb
86118
87-
<TerminalBlock>
88-
npm install -D vite-plugin-babel
89-
</TerminalBlock>
90-
91-
```js {2,11}
119+
```js {3,9}
92120
// vite.config.js
93-
import babel from 'vite-plugin-babel';
94121
import { defineConfig } from 'vite';
95122
import react from '@vitejs/plugin-react';
123+
import babel from '@rolldown/plugin-babel';
96124

97125
export default defineConfig({
98126
plugins: [
99127
react(),
100128
babel({
101-
babelConfig: {
102-
plugins: ['babel-plugin-react-compiler'],
103-
},
129+
plugins: ['babel-plugin-react-compiler'],
104130
}),
105131
],
106132
});

src/content/reference/react/useOptimistic.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ function handleClick() {
8383
8484
#### How optimistic state works {/*how-optimistic-state-works*/}
8585
86-
`useOptimistic` lets you show a temporary value while a Action is in progress:
86+
`useOptimistic` lets you show a temporary value while an Action is in progress:
8787
8888
```js
8989
const [value, setValue] = useState('a');

0 commit comments

Comments
 (0)