I am trying to print a string upon button click inside React hooks.
This button called "More Info" is inside a return tag of a hook I created. (JSX) when this is clicked it calls another function component called "ChangeName" that should print a string.
I am not sure if I am writing some wrong syntax or missing something? The console.log inside the function displays the string in the log but the div tag just doesn't print the string on the console,
created a custom hook and the button is inside its return tag.
<button onClick ={ChangeName}>More Info <button>
onclick should call and print results from the below function
function ChangeName(){
console.log("This is a test") //works
return (<div>"This is a test"</div>)
}