run function once but globally in react - Kevin Powell - Community