React-i18next: Uncaught TypeError: children is not a function

Created on 13 Feb 2018  路  7Comments  路  Source: i18next/react-i18next

I'm having some rendering issues because the children object in the <I18n> component is returning an array with two empty strings and one function, causing the error Uncaught TypeError: children is not a function. I'm not exactly sure what the problem is, but I am passing an object in as a property that has the values set as i18n.t() functions, but because it's prefixed with the i18n instance I can't see why it would be a function naming conflict.

Most helpful comment

@jamuhl I've already solved it. component has to have only 1 child component.

All 7 comments

could you please past some code? Hard to understand the problem...

closing for now...feel free to reopen with additional details

Having the same problem, any solution for this?

@jamuhl Sorry I totally forgot about this!

@matiasmagni I don't remember at this point but I believe I either restructured how I was including my various JSX snippets within the render() or I created an HOC component to handle translations that couldn't be done within the <I18n /> component described here

@matiasmagni could you paste some details? i simply guess your using the I18n component with react component as children instead of a render prop function

@jamuhl I've already solved it. component has to have only 1 child component.

Well. in my experience. ...

Was this page helpful?
0 / 5 - 0 ratings