Ok, so pages reference different URL routes, so if you're moving outside of page you can't just pass props like you would with reactRouter.
If you want to use context at the root level, you will have to wrap your context provider in a client component then wrap the children inside the layout of that client wrapper.
Try to think, is this a component that runs exclusively on the server or both? if the server you don't have any access to client side react state management, and you're limited as to what you can pass client components, ie cant pass a callback to a client function from a server function.