Yingqi Chen
Feb 7, 2021

--

Hey Lordperro, thanks for your feedback. However, I think both `useContext`and `Consumer` should work. `useContext` is cleaner without all of the nesting though but they are just different way to do it. I am curious what errors you get when it doesn't work?

You can go to the doc here: https://reactjs.org/docs/hooks-reference.html#usecontext and in the `Tips` block, you see:

"useContext(MyContext) is equivalent to static contextType = MyContext in a class, or to <MyContext.Consumer>."

--

--

Yingqi Chen
Yingqi Chen

Written by Yingqi Chen

Software engineer and a blockchain noob. Excited about the new world!!LinkedIn:https://www.linkedin.com/in/yingqi-chen/

No responses yet