Open
Description
I think this switch was not implemented: https://github.com/facebook/react/blob/v18.3.1/packages/react-refresh/src/ReactFreshBabelPlugin.js#L120-L150
The issue is that then Vite thinks that a TSX file containing code like this:
const COLORS = ['red', 'blue'].sort();
export const getColorPalette = () => COLORS;
can be self-updated, but when you edit it, it will be invalidated (Stackblitz demo, edit the list of colors)
The implementation seems really far from the Babel one, because either removing the .sort()
or remove the reference of COLORS
from the getColorPalette
function doesn't trigger ReactRefresh wrapper
Metadata
Metadata
Assignees
Labels
No labels