vitejs / vite-plugin-react

The all-in-one Vite plugin for React projects.
MIT License
585 stars 110 forks source link

Does the React plugin not support React 16? I couldn't find related documentation. #297

Closed GRAMMAC1 closed 4 months ago

GRAMMAC1 commented 6 months ago

Describe the bug

It seems that 1.0.0 already uses the JSX runtime. Does this mean that support for React 16 has been abandoned?

Reproduction

none

Steps to reproduce

No response

System Info

System:
    OS: macOS 12.6.3
    CPU: (10) x64 Apple M1 Pro
    Memory: 48.74 MB / 32.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 18.15.0 - ~/.nvm/versions/node/v18.15.0/bin/node
    Yarn: 1.22.19 - ~/.yarn/bin/yarn
    npm: 9.5.0 - ~/.nvm/versions/node/v18.15.0/bin/npm
    pnpm: 8.11.0 - ~/Library/pnpm/pnpm
  Browsers:
    Chrome: 122.0.6261.129
    Safari: 16.3
  npmPackages:
    @vitejs/plugin-react: ^4.2.1 => 4.2.1
    vite: ^5.1.4 => 5.1.6

Used Package Manager

yarn

Logs

No response

Validations

ArnaudBarre commented 6 months ago

Yeah I should document it. This plugin only make sense if your version of React support Fast Refresh, which means >= 16.9 IIRC. JSX runtime was introduced in 17 IIRC, with this plugin you can get back to default JSX transform with jsxRuntime option.

I'll keep this one open and update the Readme next time I do a change