i came across this post and i want to suggest that you could use zustand for global states in this scenario or redux depending on the type of project (large scale or small scale) you're working on. This makes things easier than having to wrap each component with context.
just thought to put it here.