-
Notifications
You must be signed in to change notification settings - Fork 6
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
🔨 yarn workspaces #96
Conversation
this.setState({ | ||
loaded: !this.state.loaded, | ||
}) | ||
this.setState(state => ({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are you using setState this way ? The other one is shorter.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because I rely on previous state value.
This way I am sure that I have the last state when the setState
take place.
Functional setState is better than object IMO
@@ -117,7 +117,7 @@ export default ( | |||
render() { | |||
const { props } = this.state | |||
if (isInError(this.props, this.state, this.context)) { | |||
return <ErrorIndicator {...props} /> | |||
return ErrorIndicator === undefined ? null : <ErrorIndicator {...props} /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using the code below doesn't work?
ErrorIndicator && <ErrorIndicator {...props} />
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah... I don't know what happens 😱
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ho I see right know why I did this:
- react render nothing if you return
null
but notundefined
fixes #92
fixes #91
related to #83
TODOs
core
andfull