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

Removed Unsafe functions and Legacy Context #169

Merged
merged 66 commits into from
Apr 3, 2018
Merged

Removed Unsafe functions and Legacy Context #169

merged 66 commits into from
Apr 3, 2018

Conversation

grahammendick
Copy link
Owner

Ready for React 17 when unsafe componentWill functions and legacy context will be dropped (more painful than it should've been because React alphas were buggy)

It meant adding crumb to state instead of to instance otherwise can't access in static function. I think that's the idea, put things in state not on instance. Manually edited enzyme adapter so that consumer and provider types recognized (jquense/enzyme@b3a6eb1). Updated tests to use NavigationHandler instead of context
Not needed now don't ever listen to navigation changes
Was only there so it could work with all version of React
When react typings updated this should be automatic from generic state type
The prevState didn't get rest = true even after set to true in clearScene. Worked around by only updating state if scene's changed. Weirdly, it seems to get rest = true after this change!?
This had me stumped for ages. I'm pretty sure React will have to add a non-static prop update function before componentDidUpdate for raf animation. Moving it into didUpdate meant had to rerun the getItems to check if it needs the raf added?!
I had so much trouble with this becuase of a bug with the new context api. With this change the raf runs forever, even after the animation completes. Thought that meant couldn't use this approach but really just a bug with context api. See facebook/react#12335. Need to retest this when next alpha comes out and check the raf stops running
Means that Links still render outside of a Provider/NavigationHandler. Can test a component without provider context, links will have null href's.
Caused a lot of problems for the test setup because first time needed navigation from navigation-react (Link utility references it for type checking but these disappear once compiled). Could've built the navigation package and stuck it in node_modules first but this would've slowed down the tests a lot. Instead used paths ts config option to point at physical file
Resolved modules as local source files in typescript config
The Context needs the StateNavigator
Allows components to render outside of NavigationMotion
When navigating back from zoom details to list, the shared element motion tick now fires before the navigation motion tick. That's because the shared el tick is registered in componentDidMount but the navigation tick is registered in componentDidUpdate (they used to both be registered in componentWillMount). So when the shared el tick fires the progress is still set to 1 but it should be 0
@grahammendick grahammendick merged commit 0466372 into master Apr 3, 2018
@grahammendick grahammendick deleted the react-17 branch April 3, 2018 11:12
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