Skip to content

docs: improve React-related sections in troubleshooting and plugins#22120

Closed
palpavasiya wants to merge 2 commits into
vitejs:mainfrom
palpavasiya:docs/react-core-improvements
Closed

docs: improve React-related sections in troubleshooting and plugins#22120
palpavasiya wants to merge 2 commits into
vitejs:mainfrom
palpavasiya:docs/react-core-improvements

Conversation

@palpavasiya
Copy link
Copy Markdown

Description

This PR adds practical React-specific guidance to help developers better understand and avoid common pitfalls when using Vite with React.

Changes:

  1. docs/guide/troubleshooting.md

    • Added a new subsection ### React Fast Refresh caveats under the HMR section.
    • Covers the most common reasons React components cause full reloads instead of hot updates:
      • Mixing component and non-component exports
      • Anonymous default exports
      • Class components
  2. docs/plugins/index.md

    • Improved descriptions for @vitejs/plugin-react and @vitejs/plugin-react-swc.
    • Added a clear "Choosing between plugin-react and plugin-react-swc" tip box to help developers make the right choice.

These updates address frequent questions and pain points from the React community when using Vite.


Why this is valuable:

  • Reduces debugging time for thousands of React + Vite users
  • Improves documentation clarity without changing any behavior
  • Pure documentation improvements

Notes:

  • No breaking changes
  • No code changes, only documentation

@palpavasiya palpavasiya closed this by deleting the head repository Apr 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant