execute 2 functions onclick react code example
Example 1: react js onclick call two functions
<a href="#" onClick={() => { func1(); func2();}}>Test Link</a>
Example 2: react onclick to make another button
import React from 'react';
const App = () => {
const message = () => {
console.log("Hello World!")
}
return (
<button onClick={message}> Press me to print a message! </button>
);
}