How to fix Invalid hook call. Hooks can only be called inside of the body of a function component. in React | DevErrors