-
Notifications
You must be signed in to change notification settings - Fork 15
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
Typescript #35
base: master
Are you sure you want to change the base?
Typescript #35
Conversation
@nayaabkhan I see you have started a Typescript-Rewrite. I do have some interest in getting rid of the I'd also be happy to help, I was just wondering whether it made sense at all to supply a patch for this based on the current JavaScript develop branch or whether I should rather wait for you to finish the TypeScript rewrite?! |
@ctavan I think it is better to patch the The commit at c5c6fac is pretty much all we need but maybe if we can trim it down to only the substitution of |
@nayaabkhan I just realized that in 9210c44 componentWillReceiveProps was replaced by componentDidUpdate. This means that with 0.6.0 the react deprecation warning is gone. I'm still a bit concerned whether Also, what was confusing me in the first place is that the current |
@ctavan Ah yes, I forgot to bring About |
@ctavan Thanks for pointing out about the |
Thanks! Which means we still need a different way of doing this in order to remain compatible with |
The issue with componentDidUpdate is that although we do update the polyglot instance it only happens after we have rendered. Is there any reason why we cant just do the check inside render(). Something like if (this.polyglot.currentLocale !== this.props.locale) {
this.polyglot.locale(this.props.locale);
} That way we update the instance then create a new bound function that would trigger a re render of the Context consumers. I can work on this change as well since we have run into issues where changing locale wont trigger re render. **EDIT: The workaround we use now is to pass in a key prop for |
No description provided.