-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Style Parent Element #210
Comments
You mean for the Interpolate Component?!? What you want to render? Could you paste some code snipplet?!? |
I'am using a Component from the Material-UI framework, which receives a plain text as a secondaryText prop. Just dropping a Text with the Interpolate component with the default span parent breaks it's styling, the p element at least displays it in a block as it should be. Using the HOC method to translate the text worked like charm before, however I switched to the Interpolate method because I had issues calculating the size of the Element the text is rendered into.
|
I'm rather sure we allow className on that: https://github.com/i18next/react-i18next/blob/master/src/interpolate.js#L47 think we should do the same for style prop?!? If you like you might add a PR for that to speed new version up...else i will add this asap (but not earlier ;)) |
Ah okay, with this i could create a workaround. However a style prop would be cleaner, at best the parent should be an actual component instead of a plain string. |
You can pass your own component as parent - but obviously useless right now as no props get passed to it beside the className. For that we would need to remove all props that where used in for the interpolation and pass the rest of the props down to the parent component. Should be possible...but like said...hard on time so don't expect this to land very soon. PR would be very welcome. |
style prop will be passed to the interpolate container in next version |
I can't find a way to properly style the parent element the text is rendered into. Can't provide a class or style property.
The text was updated successfully, but these errors were encountered: