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

initialize state to null if not when not set #1310

Merged
merged 2 commits into from
Oct 31, 2017

Conversation

mattfysh
Copy link
Contributor

@mattfysh mattfysh commented Oct 31, 2017

Fixes #1249

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.

@mattfysh
Copy link
Contributor Author

This fixes an issue with react-emotion due to an explicit check in their library for null:

https://github.com/emotion-js/emotion/blob/master/packages/react-emotion/src/index.js#L82

The react-apollo SSR walk needs to be updated to match React behaviour, i.e. isNull(this.state)

@mattfysh mattfysh changed the title initialize state to null if not set by components constructor, fixes … initialize state to null if not when not set Oct 31, 2017
@mattfysh
Copy link
Contributor Author

@jbaxleyiii - this is a rework of #1300 applied to latest master, however tests in an unrelated area are failing. Does this mean they are also failing in master? I can't see any changes I've made that could affect the unit tests that are breaking. Thanks! 👍

@jbaxleyiii
Copy link
Contributor

@mattfysh yep not you! That's a flaky test I need to rewrite haha

@jbaxleyiii jbaxleyiii merged commit b52b017 into apollographql:master Oct 31, 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.

During SSR, default state of a component should be null (not undefined)
2 participants