How to fix Too many component layers with prop drilling in React | DevErrors