Use Effect With Empty Array Javascript Function Declaration