Epic React V2

Optimize Context - Memoize Context

(See readme.mdx)

You will notice all the components re-render whenever you change the counter in the App component. This is happening because the FooterContext is a new value prop every render.

So if you memoize the value prop with useMemo, you can prevent the unnecessary rerender of consuming components when the value prop does not change.

Set the footer color:

Set the footer name:

I am the (black) footer, Unnamed