Skip to content

Potentially migrate to setState instead of replaceState #48

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

Closed
ethul opened this issue Oct 3, 2015 · 1 comment
Closed

Potentially migrate to setState instead of replaceState #48

ethul opened this issue Oct 3, 2015 · 1 comment

Comments

@ethul
Copy link
Contributor

ethul commented Oct 3, 2015

Currently, replaceState is used in the writeState function.

ctx.replaceState({
state: state
});

However, from the docs, replaceState may be removed in the future.
https://facebook.github.io/react/docs/component-api.html#replacestate

Since the state is wrapped in {state: state} I believe we'd get the same behaviour even though setState does a shallow merge instead of a complete state replacement.

I hope to have a chance to prepare a PR for this. But I wanted to note it down.

@ethul ethul changed the title Potentiall migrate to setState instead of replaceState Potentially migrate to setState instead of replaceState Oct 3, 2015
@paf31
Copy link
Contributor

paf31 commented Oct 3, 2015

👍 Sounds good.

@ethul ethul closed this as completed in 0106a98 Jan 25, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants