Open DingoEatingFuzz opened 6 years ago
Probably there is no way fix it, as long RHL should not be applied to this library at all, as long this is not "React", just mimicking some interfaces.
"Cold" components (https://github.com/gaearon/react-hot-loader/pull/992) should fix it completely, by disabling RHL for this library.
Cold components sounds awesome! Sounds like the blacklist feature I was looking for 😄
class ScatterplotLayer extends Layer
while Layer extends React.Component
I have no idea why you example is failing :(
Interesting. I'll try to make a repro repo.
Probably fixed in v4.3.0 Anyway - could be fixed by "cold api", also in 4.3.0
@theKashey not fixed by default in v4.3.0. Also error points not to a library but to the one of constructors of a component, so I'm unsure how excluding a component from hot reloading would help. It'd be the same as disabling the hot loader entirely, because it crashes randomly with different classes.
Then, I need some example to play with.
I met the same error when upgrading from 4.3.12 to the latest 4.6.3. Everything seems to be fine at version 4.3.12 even though my project is using react 16.6.3.
Just give me an example to reproduce the error, or open a PR with a failing test.
"react-hot-loader": "^4.12.21", "react": "^16.14.0", "react-dom": "^16.14.0"
Still have problems
Description
When a transpiled ES6 class is reloaded, it is called as a function. This results in an error
It looks like there is already code to circumvent this issue if the module is a React Component class:
https://github.com/gaearon/react-hot-loader/blob/2ec25210c8a2704a9a0818a49c1f897c3e579e86/src/proxy/createClassProxy.js#L114
But not all class modules are React components. I ran into this using deck.gl ScatterplotLayer.
Expected behavior
This module should be called like
new Component(...)
instead of plainComponent()
.Actual behavior
This module falls into the
isFunctionalComponent
code path and throws a runtime error due to the transpiler typechecking.Environment
React Hot Loader version: 4.2.0
Run these commands in the project folder and fill in their results:
node -v
: 8.11.1npm -v
: 5.6.0Then, specify: