This repo is a demonstration of HMR breaking in Vite, when consuming React's context
(both through useContext
and CountContext.Consumer
).
Steps to reproduce:
npm install
npm run dev
- make a change inside
src/CountProvider.jsx
(any change, add a whitespace for instance) - watch the white screen and TypeError logged into browser console
To see the difference from the default vite starter, see this commit