I am getting function name in the form of a string from the backend i need to add it to onClick event of a button in react but getting error ReactJS: Expected onClick listener to be a function, instead got type string how can i add the string to onClick function
response object from backend :
[
{option : {onClickFunc : "getReleaseNotes"}}
],
React on front end
<div onClick={option.onClickFunc}>
</div>
error on click :
ReactJS: Expected onClick listener to be a function, instead got type string