Problem
Vite's Fast Refresh often fails for Context Provider files because they export both the Context and the Provider component. This triggers a lint error: Fast refresh only works when a file only exports components.
Proposal
Separate the context creation and the Provider component into different files.
- Move
createContext calls to dedicated .js files (e.g., AuthContextInstance.js).
- Keep the Provider component in the
.jsx file.
- Update imports across the app.
Scope
- DX (Developer Experience) / Code readability
Assign this issue to me under the oscg