I hope you like it. I am almost new to this so I would appreciate any comment. It changes every 8 seconds, unless you click a button. If you do, it lasts 12 seconds and returns to the 8-second loop. The correct way to do this would be to run the effect only once. Since you only need to run the effect once because during mounting, you can pass in an empty array as a second argument to achieve.
I hope you like it. I am almost new to this so I would appreciate any comment. It changes every 8 seconds, unless you click a button. If you do, it lasts 12 seconds and returns to the 8-second loop. The correct way to do this would be to run the effect only once. Since you only need to run the effect once because during mounting, you can pass in an empty array as a second argument to achieve.
I hope you like it. I am almost new to this so I would appreciate any comment. It changes every 8 seconds, unless you click a button. If you do, it lasts 12 seconds and returns to the 8-second loop. The correct way to do this would be to run the effect only once. Since you only need to run the effect once because during mounting, you can pass in an empty array as a second argument to achieve.