-
Notifications
You must be signed in to change notification settings - Fork 801
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
4.5.1 - Objects are not valid as a React child #1115
Comments
This is 4.5.0 change. By default configuration, SFCs are wrapped by a complex thing, which returns a class instance from SFC call(it's a long story). This "conversion" could be done only once, during the first component render. Later would lead to an error. 4.5.0 adds "early reject" if render return null. And later returns class wrapper, when it's already too late. For now, you can solve this by setting |
Should be fixed in 4.5.2 |
Thanks! Looks like it works. |
Description
We have the following component:
Initially, when you arrive on a page,
visible
is false. So, component will render nothing.Later, when visible change to true,
some content
should be rendered.Expected behavior
Should show/hide content based on props.
Actual behavior
Changing visible to TRUE throws the following error:
Possible workarounds:
if (!visible) return null
withif (!visible) return <div />
Environment
React Hot Loader version: 4.5.1
React version: 16.6.3
React DOM version: 16.6.3
The text was updated successfully, but these errors were encountered: