We created here 2 context – instead of 1
I make a codesendbox for us to see the fix.
We should create context only one time, to wrap the App component with the provider, and we can use this context like you did wherever we want
And relative to the beginner, it seems from your code that you understand what you are doing
about your comment – attached a pic
CLICK HERE to find out more related problems solutions.