This is an example of how react events occur on a button click respectively We created this example with the following commmands:
npx create-react-app app-namecd into the newly created react projectnpm runthis starts the project
We have left the comments in the code as a means to try out each scenario This will help to understand the various manners that the react code is ran