How would I take a string, and convert it to jsx? For example, if I bring in a string from a textarea, how could I convert it to a React
I came across this answer recently and, it was a good deal for me. You don't need to provide a string. Returning an array of JSX elements will do the trick.
We can store JSX elements in JavaScript array.
let arrUsers = [- Steve
,- Bob
,- Michael
];
and in your HTML (JSX) bind it like,
{arrUsers}
As simple as it is.