I\'m having trouble with React\'s Render processing.
There is a function called func1 and func2, which is called when rendering (eg: return (
).
Firstly, React components name must begin with uppercase character, check this question for more details
React - User-Defined JSX Components Not rendering
Secondly instead of storing
{funcName: "Func1"}
you would store
{funcName: Func1}
and then render like
render() {
const Func1 = obj.funcName;
return <Func1/>
}
or if you can't replace the string with component in your data, you would do
render() {
const Func1 = eval(obj.funcName);
return <Func1/>
}
Instead of putting it as element <func2 />
call the function func2()
But you func2 must return a valid react element.