let Bio = {
username: 'hyggedev',
fullName: 'Chris Hansen',
bio: 'I create⚡️ fast modern, client-side websites with React and Javascript.',
passion: ['Blog', 'Tweet', 'Code']
};
Hey great article D: So just to clarify, Context is not for state management, as you can handle state anyway you like, but the ContextProvider allows you to have access to that data anywhere without prop drilling? Is my mind in the right place? I know how to use it, I just hope I know WHY I'm using it LOL. Thanks ahead.
You are correct, except Context Provider does not allow to have access to that data anywhere. It's only within React Components that are descendants of that Provider.
What's most important Context does not give any option to access it's data outside the React tree (Redux and other State Management library do)
let Bio = {
username: 'hyggedev',
fullName: 'Chris Hansen',
bio: 'I create⚡️ fast modern, client-side websites with React and Javascript.',
passion: ['Blog', 'Tweet', 'Code']
};
Hey great article D: So just to clarify, Context is not for state management, as you can handle state anyway you like, but the ContextProvider allows you to have access to that data anywhere without prop drilling? Is my mind in the right place? I know how to use it, I just hope I know WHY I'm using it LOL. Thanks ahead.
You are correct, except Context Provider does not allow to have access to that data anywhere. It's only within React Components that are descendants of that Provider.
What's most important Context does not give any option to access it's data outside the React tree (Redux and other State Management library do)
Ahh okay gotcha. Perfectly said, I get it now. Thanks! 👌