Skip to content
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

Supported React's new Context Api #160

Merged
merged 90 commits into from
Mar 31, 2018
Merged

Supported React's new Context Api #160

merged 90 commits into from
Mar 31, 2018

Conversation

grahammendick
Copy link
Owner

Backward compatible. The Navigation React tests pass unchanged.
Streamlined Navigation React samples down to 4 primitives. They can be combined together to build a code split, isomorphic relay app, for example.

Gets the build working
There was odd state/props combo for name/initial name. React 16.3 doesn't like willReceiveProps anyway. So went with navigating on change instead
There's a React bug with the check - click Name sorter twice and it gets stuck - React fibre's in some infinite loop. Think it worked before 16.3 but the check isn't doing anything because it checks all props so ok to remove
Changed context tests so that context passed down to children. Didn't matter before because Link was the top level before - now it's wrapped in HOC and Consumer
It cluttered up the server file. Better to use dev tools to slow down the connection (added note to readme)
Relay modern's been around for a while. Don't want to bring old relay sample up to use the new context (not sure it's possible?)
Superseded by react mobile plugin
Hangover from original relay sample
Better to keep samples as primitives than combine two random ones
Wrapped in withStateNavigator HOC like implemented for React plugin
Tried changing to componentWillReceiveProps and it did work, but it was called multiple times. Not sure about this. Anyway, componentWillReceiveProps is deprecated for getDerivedStateFromProps but can't change to this because won't work in old React (and it's called multiple times). When come to do SSR then need it to work with a navigation, first render, so can revisit then
This doesn't work in the React plugin sample!? wonder what the difference is? List isn't the root component here?!
It works with stateNavigator.start before ReactDOM.render. This makes it consistenet with Navigation React. Better to put start first because it has to be first for server side rendering when that comes
Formats better on npm
The infinite loop's fixed with the latest react release
@grahammendick grahammendick merged commit 06d948a into master Mar 31, 2018
@grahammendick grahammendick deleted the context-api branch March 31, 2018 13:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant