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

Update to new Context API #26

Closed
LPGhatguy opened this issue Jan 17, 2020 · 0 comments · Fixed by #38
Closed

Update to new Context API #26

LPGhatguy opened this issue Jan 17, 2020 · 0 comments · Fixed by #38

Comments

@LPGhatguy
Copy link
Contributor

We're about to land a new context API that lines up with React's context API.

We should port Roact-Rodux to this new API in order to not hold up removal of the old context API.

I did a rough evaluation of this today and found:

  • UNSTABLE_getStore may be infeasible to replace, but is used internally at Roblox in a number of places.
  • StoreProvider is easy to change
  • connect will need significant non-trivial changes and is already difficult to grok
ZoteTheMighty pushed a commit that referenced this issue May 21, 2021
This fix Closes #26

Issue: StoreProvider and Connect used the legacy context API, this change updates it to the new API

Fix: Added a file StoreContext.lua that returns a static Roact Context. StoreProvider now returns a Roact Provider that passes a Rodux Store as its "value". Connect now uses a Roact Consumer to read in the store via props.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant