Skip to content

Commit b2d4120

Browse files
committed
fix: add a mention of @vitejs/plugin-react
1 parent 26c6400 commit b2d4120

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,10 @@ test('should increment counter', async () => {
4444
```ts
4545
// vitest.config.ts
4646
import { defineConfig } from 'vitest/config'
47+
import react from '@vitejs/plugin-react'
4748

4849
export default defineConfig({
50+
plugins: [react()],
4951
test: {
5052
setupFiles: ['./setup-file.ts'],
5153
browser: {
@@ -59,6 +61,8 @@ export default defineConfig({
5961
import 'vitest-browser-react'
6062
```
6163

64+
> 💡 Note that `@vitejs/plugin-react` is recommended for some of React's features to work (like auto importing of `React`). You can also configure [JSX](https://vite.dev/guide/features#jsx) options manually.
65+
6266
```tsx
6367
import { page } from 'vitest/browser'
6468

0 commit comments

Comments
 (0)