I have use case to render component from database. In data base they are stored as string format like below:
let Sample = `({firstName})=><h1>My name is {firstName}</h1>`;
When I try to render this in react, it shows as string. How to render string type of functional component.
class App extends Component {
this.state = {
"sathish" : "firstName",
}
render (){
// how do it use string of functional component like below
return <Sample firstName={this.state.firstName} />
}
}