That React Component Right Under Your Context Provider Should Probably Use React.memo
Video Statistics and Information
Channel: Leigh Halliday
Views: 13,952
Rating: undefined out of 5
Keywords: react performance, react context, react memo, context provider, react context provider, react hooks, react, react useContext, react re-rendering, prop-drilling, react props, react state, react context tutorial, react memo tutorial
Id: CDGBTjMBJzg
Channel Id: undefined
Length: 9min 47sec (587 seconds)
Published: Tue Feb 18 2020
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.
Pheeeew, thank you for clarifying that. I've been using a shared provider forever and couldn't figure out WTF all this useMemo jibber jabber was all about lately. Good to know that I'd inadvertently solved the 'issue' from the start!
follow up to https://www.reddit.com/r/reactjs/comments/f53ff7/that_react_component_right_under_your_context/
Following Brad Traversy's courses I've always declared the Context in another component and passed the children inside the provider.
<ContactContext.Provider value=*{*{ contacts: state.contacts }*}* \>
{props.children}
</ContactContext.Provider>
Then in the App main component I pass all the Context and wrap the routes and pages.
I don't need to use memo in this case right?