-
Notifications
You must be signed in to change notification settings - Fork 800
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Warning for Async HOC component #1069
Comments
Quite interesting approach. It would be great if you will provide any example to play with. I am almost absolutely sure about two things:
Probably here problem is with components |
It might take me some time to assemble a reproducible repo. However I set a breakpoint where the warning is and these are the values - not sure whether it will be useful at all. Code for defaultProps can be found here https://github.com/acdlite/recompose/blob/master/src/packages/recompose/defaultProps.js |
Ok, look like the problem is about seeing "LoadingComponent" in React tree, while a "target" component has been rendered by fact. Somehow similar to #1050 This happens cos RHL is "always enabled" and trying to did it's job even without actual "HMR" event. Right now there is no way you can solve this issue (this is not a real issue) - probably just suppress warning. Everything should work - it just reporting about situation it could not handle, and shall not handle. |
Thanks for taking the time! I'll most likely try to wrap every async component in hot(module) as it clears out undefined in the Updated modules list and solves the warning, it's just a little bit cumbersome to do it for every async component.
|
import {setConfig} from 'react-hot-loader';
setConfig({logLevel: 'error'}); // and this is default value! |
The reason why I enabled logging in the first place was to find out why Updated modules are undefined as I was getting a pretty long list of undefined. I'm not sure whether it's related to the first issue with the warning but if I wrapped it with hot it actually solved the undefined logging so I thought that I must be doing something right :-) |
Try to find the origin of |
Thanks man, it seems to be related to webpack-hot-middleware - I'll continue my investigation over there. webpack-contrib/webpack-hot-middleware#306 |
Whenever I'm importing async modules with react-loadable that I later wrap with a HOC
I get a following warning:
The reason is most likely the fact that I'm wrapping my async component with a HOC defaultProps on component load. If I don't do it (which I can't do it because I can only set defaultProps HOC during runtime), warning disappears. Warning also disappears if I wrap the whole module with hot(module)(MyAsyncComponent). The problem with the latter is that I have many components that would need to be wrapped like that and the whole HMR is working fine even without it, it just generates this warning that I would love to fix, ideally without suppressing warning logs.
I'm running the latest version of everything (webpack 4, babel 7, react 16.5, RHL 4.3.8)
Thanks!
The text was updated successfully, but these errors were encountered: