React Refresh seems to break when using function hoisting #28550
Labels
Needs: Author Feedback
Needs: Environment Info
Please run `react-native info` and edit your issue with that command's output.
Stale
There has been a lack of activity on this issue and it may be closed soon.
I had some weird error:
TypeError: Attempted to set a non-object key in a WeakMap
when trying to return some component function 'before' it's defined using hoisting.
If I dive a bit deeper into stack:
seems
react-refresh/cjs/react-refresh-runtime.development.js
tries to callcreateSignatureFunctionForTransform
, thensetSignature
and then trying to assign undefined toallSignaturesByType
which is WeakMap so undefined cannot be the keyIf I reverse the operations (I return component after it's function is defined) it works just fine.
react-native info
The text was updated successfully, but these errors were encountered: