-
Notifications
You must be signed in to change notification settings - Fork 88
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
Moving to version 3.0 #67
Comments
🎉 Release candidate is ready!!! 🎉For those that wish to try out
To run the basic example, run the following from the root of
If you are coming from Lastly if you find any bugs please open an issue, and be sure to mention the release candidate version you are on. |
i am using "react-localize-redux": "^3.0.0-rc3". but i could not find |
@priyankmtr can you elaborate on what you mean by "I could not find" Also I've updated the broken basic example link. |
Hi @ryandrewjohnson, Thanks for fixing the link. I got it now. It is working good. But when i am trying to include localeReducer in rootReducer, i am getting the issue, that i have shown in the attached image. Kindly pardon me if there is something wrong from my end. I am new to reactJS. package.json:-
The difference between example and my application is, my application is using typescript. thanks. |
I tried to go with the way shown in the official docs.
in my routes.tsx file. It is showing me error, that this module has no exported member 'LocalizeProvider'. |
@priyankmtr are you sure that you have installed the library? It doesn't show up in your dependencies, and if you use npm > v5 it should autosave. |
@priyankmtr it looks like the type definition was missing for I have published an updated release candidate that can be installed like so:
|
Quick question regarding the // Translate.js
constructor(props: TranslateProps) {
super(props);
this.state = {
hasAddedDefaultTranslation: false
};
}
componentDidMount() {
this.setState({ hasAddedDefaultTranslation: true });
}
addDefaultTranslation(context: LocalizeContextProps) {
if (this.state.hasAddedDefaultTranslation) {
return;
}
...
} If I use export default () => (
{someCondition ?
<Translate id='id_one'>DEFAULT 1</Translate> :
<Translate id='id_two'>DEFAULT 2</Translate>
}
)
I can somewhat verify this by adding a I'm not sure how much of an edge case this is considered, or what the best solution is but my initial suggestion would be:
There is possibly another way using
static getDerivedStateFromProps(nextProps, prevState) {
if (prevState.lastKnownId === nextProps.id) {
return null
}
return { hasAddedDefaultTranslation: false, lastKnownId: nextProps.id }
}
// need to save the last known id in state because you cannot access `this` in gDSfP.
Happy to submit PR. |
@thchia if you have time to do a PR with some tests covering the issue that would be much appreciated. I'm just getting things wrapped up with the v3.0 launch, so if you're able to tackle this before I release on Monday that'd be amazing. |
@ryandrewjohnson opened in #79. I appreciate you accommodating my contribution efforts 😄 |
The next major release is in active development with the biggest update being the removal of the dependency on redux. By leveraging React's new Context API the library will now work without redux, while still providing the option to use redux for those users using it in their app.
Release plan:
✅ release-candidate - READY!!!
✅ release v3.0.0
Todo for release:
✅ should work without redux by default
✅ should work with redux if store provided to
LocalizeProvider
✅ option to show default language on missing translation
✅ correct spelling for add language action #71
✅ update documentation
✅ battle test new TypeScript definition #69
✅ update examples
✅ document breaking changes
✅ provide migration guide
What's changed?
See official change log.
The text was updated successfully, but these errors were encountered: