Yup! Only components which subscribe to the Context changes, i.e, Consumers will re-render. However, Context should only be used when you require a few props to be available to a ton of components in a component tree, and prop drilling becomes cumbersome.
Yeah you are both right, my mistake...But still, the component will re-render even if the values that it's using from that Context instance don't change.
Still, it might be better to use multiple Context instances for multiple parts of the app, instead of having single Context provide bunch of values to many many components (eg. wrapping your whole app inside a single Context provider)
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Yup! Only components which subscribe to the Context changes, i.e, Consumers will re-render. However, Context should only be used when you require a few props to be available to a ton of components in a component tree, and prop drilling becomes cumbersome.
Yeah you are both right, my mistake...But still, the component will re-render even if the values that it's using from that Context instance don't change.
Still, it might be better to use multiple Context instances for multiple parts of the app, instead of having single Context provide bunch of values to many many components (eg. wrapping your whole app inside a single Context provider)