How to fix Hook can only be called inside the body of a function component in React | DevErrors