We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I use the latest react-hot-loader. I have a component that looks roughly like this:
react-hot-loader
import Child from './Child'; function Parent({ children }) { invariant( Children.only(children).type === Child, 'child must be of type Child' ); ... }
it checks that a child is of type Child. Thing is that the .type is the proxied type, while Child is the original Child, so equality fails.
Child
.type
When I debug and click on .type in Chrome it shows the generated code:
(function(factory,instantiate /*``*/) { return function Children() { return instantiate(factory, this, arguments); } })
What's the best practice for comparing with a proxy? I could add a static prop and compare it but that seems dirty.
The text was updated successfully, but these errors were encountered:
Dup of gaearon/react-hot-loader#304, closing
Sorry, something went wrong.
No branches or pull requests
I use the latest
react-hot-loader
. I have a component that looks roughly like this:it checks that a child is of type
Child
. Thing is that the.type
is the proxied type, whileChild
is the originalChild
, so equality fails.When I debug and click on
.type
in Chrome it shows the generated code:What's the best practice for comparing with a proxy? I could add a static prop and compare it but that seems dirty.
The text was updated successfully, but these errors were encountered: