-
Notifications
You must be signed in to change notification settings - Fork 326
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
Redirect crash when used with Webpack HMR #153
Comments
After some investigation I discovered probably a better solution here. Instead of making a tricky workaround replacement of parameters it's better to mark all components from |
Closing because I think the |
@tpolovyi I think this is still an issue if you work in a monorepo setup. Local packages are symlinked in node_modules. So if I understand it correctly then if I change a local package which is a dependency to my main project it won't be detected by RHL. Is that correct? |
Hi. I've come across the issue with using
<Redirect />
alongside with HMR. The point is that, when HMR is set up and router has a redirect as a child, it prevents app from starting with following error:Here is a codesandbox with the complete code.
I've found out a workaround to make it work: all is needed is to replace
from
property withpath
:In this case the condition here is evaluated to
true
, otherwiseelement.type === Redirect
isfalse
due to the way how, I think, HMR works in Webpack:element.type
has a different reference from theRedirect
inside library.The text was updated successfully, but these errors were encountered: