Pass JSX as params
See original GitHub issueIs there any way to pass JSX as parameter to the translation function? I’m trying to do something like this:
const name = <span className="name">{user.name}</span>;
return this.context.t("Hello {name}!", {name: name})
Thanks!
Issue Analytics
- State:
- Created 7 years ago
- Reactions:1
- Comments:8 (6 by maintainers)
Top Results From Across the Web
javascript - ReactJS(jsx) Passing Parameters - Stack Overflow
ReactJS(jsx) Passing Parameters · 1. Paste your code. Not an image. · 1. The props in React component is expected to be in...
Read more >Passing Props to a Component - React Docs
React components use props to communicate with each other. Every parent component can pass some information to its child components by giving them...
Read more >How to Pass Data between React Components | Pluralsight
This guide summarizes three approaches to handling data in React: Passing ... The primary concept is passing the parameters to the following ...
Read more >How to use Props in React - Robin Wieruch
Since props can only be passed from parent to child components, how can a child component communicate with its parent component? This a...
Read more >How To Pass Params to a Component in React Router
Run the React App and you will see the links displayed. As you click on any of the links, it will take you...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Cool. Really grateful for this tool. I was worried when I had to add i18n to my project but this little tool solved the problem with minimal effort. Thanks!
Hi,
I just see that we can’t print html directly for security reasons. You should use “dangerouslySetInnerHTML” method. I’ve updated documentation in this branch:
https://github.com/APSL/redux-i18n/tree/trans_to_reducer#html-object-as-parameter
I’ll merge to master as soon as possible. Thanks.