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
State/props passed to children() shouldn't be mutated.
children()
render() { return this.props.children({ data: this.state.data, error: this.state.error }) }
In this example data and error shouldn't mutated by the consumer.
data
error
To prevent mutation, I think that we can do something like this:
render() { const frozenState = deepFreeze({ ...this.state }) return this.props.children(frozenState) }
The text was updated successfully, but these errors were encountered:
I won't implement it for now.
Sorry, something went wrong.
Freezing is also somewhat slow, I'd only recommend it in development.
Thank you @gaearon
hnordt
No branches or pull requests
State/props passed to
children()
shouldn't be mutated.In this example
data
anderror
shouldn't mutated by the consumer.To prevent mutation, I think that we can do something like this:
The text was updated successfully, but these errors were encountered: