Skip to content
This repository has been archived by the owner on Apr 13, 2023. It is now read-only.

Support passing updater function to setState in SSR mode #1263

Merged
merged 4 commits into from
Oct 24, 2017

Conversation

mdebbar
Copy link
Contributor

@mdebbar mdebbar commented Oct 21, 2017

Passing an updater function to setState() is something that React supports and people use this pattern. Fortunately, supporting that pattern in react-apollo's SSR mode is simple, so I added it and covered it with a test.

Checklist:

  • If this PR is a new feature, please reference an issue where a consensus about the design was reached (not necessary for small changes)
  • Make sure all of the significant new logic is covered by tests
  • If this was a change that affects the external API used in GitHunt-React, update GitHunt-React and post a link to the PR in the discussion.

@mdebbar mdebbar changed the title Support setting state via callback in SSR mode Support passing updater function to setState in SSR mode Oct 21, 2017
@jbaxleyiii jbaxleyiii merged commit 956aaa8 into apollographql:master Oct 24, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants