8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hi,
On react-i18next >= 1.5.0, universal rendering is broken. Error: Invariant Violation: React DOM tree root should always have a node reference.
Invariant Violation: React DOM tree root should always have a node reference.
Related to this issue react issue, this line might be the cause.
A rerender occur on server-side because of a setState inside the componentWillMount hook
setState
componentWillMount
My server side setup :
match({ routes, location}, (error, redirectLocation, renderProps) => { if (error) { res.status(500).send(error.message) } else if (redirectLocation) { res.redirect(302, redirectLocation.pathname + redirectLocation.search) } else if (renderProps) { loadNamespaces(Object.assign({}, renderProps, {i18n})) .then(() => { const isNotFound = renderProps.routes.find((route) => { return route.status === 404 }) const locale = req.language const locales = res.locals.locales const component = ( <I18nextProvider i18n={req.i18n}> <RouterContext {...renderProps} /> </I18nextProvider> ) res.status(isNotFound ? 404 : 200).send('<!doctype html>\n' + renderToStaticMarkup(<Html assets={webpack_isomorphic_tools.assets()} component={component} />)) }) } else { res.status(404).send('Not found') } })
// html.js render() { const { assets, component} = this.props // throw error below const content = component ? ReactDOM.renderToString(component) : '' }
Do you have any clue?
Thanks
The text was updated successfully, but these errors were encountered:
could you please try with react-i18next@1.5.2?!?
Sorry, something went wrong.
@jamuhl Issue fixed 👍
perfect
No branches or pull requests
Hi,
On react-i18next >= 1.5.0, universal rendering is broken.
Error:
Invariant Violation: React DOM tree root should always have a node reference.
Related to this issue react issue, this line might be the cause.
A rerender occur on server-side because of a
setState
inside thecomponentWillMount
hookMy server side setup :
Do you have any clue?
Thanks
The text was updated successfully, but these errors were encountered: