Answer the question
In order to leave comments, you need to log in
How to make one function for all elements in react?
Good afternoon! Please tell the inexperienced if there is a way to extend one function to all elements in the program? For example: I have an application with several pages, and on each page there is a counter for seconds of user inactivity, which after a certain number of seconds, redirects the user to the main page. How can I (if possible) without writing a function on each element write it in one place and spread it to the whole program as a whole?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question