|
|
|
|
|
by ddek
2239 days ago
|
|
I can call ‘setTimeout’ from the component? I honestly don’t see the issue with your example. I’d use an event handler to work out when something happened. This would set the timeout, and the handle would be stored as a ref. I’d have a use effect hook to clean up the timer, so when the component is unmounted the timeout is cleared. What’s the issue here? |
|