Skip to content

Use React new context API #82

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

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open

Use React new context API #82

wants to merge 7 commits into from

Conversation

p10ns11y
Copy link

@p10ns11y p10ns11y commented Apr 7, 2018

Consider this work as beta. ie., I need inputs/feedback from the maintainers what to do with tests. Right now I have added only one

"react-redux": "^5.0.6",
"react-scripts": "1.0.17",
"redux": "^3.7.2",
"redux-i18n": "^1.5.10",
"redux-i18n": "https://github.com/p10ns11y/redux-i18n#master",
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO: change after merged and version is bumped

@p10ns11y p10ns11y changed the title Use React new context API and provide a provider component for react.16.3 users Use React new context API Apr 7, 2018
@zhihil
Copy link

zhihil commented Feb 20, 2019

This would be a valuable change. I am working on a React app using Typescript and type-checking prohibits the use of React's legacy context api, i.e., contextTypes.

I'm getting this error:

screen shot 2019-02-20 at 9 45 22 am

Supporting the new React context api would make it easier to work with redux-i18n out of the box with Typescript.

Are there any plans to merge these changes in?

EDIT: The solution was simple. Make .contextTypes a static property of the class you want to subscribe to redux-i18n's context.

@JosephBrooksbank
Copy link
Contributor

Are there any plans to merge this in? React strongly advocates against the use of legacy context

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.

3 participants