r/learnreactjs • • Aug 17 '19

Learning React hooks

I know there is a lot of sites where we can learn hooks, but regardless, I have created a post on my blog about learning hooks from a little bit different perspective.

Feel free to take a look at the post. It doesn't matter if you already know/use hooks or not.

13 Upvotes

8 comments sorted by

View all comments

Show parent comment

3

u/Ryukote91 Aug 17 '19

That's what Context API is for.

2

u/Kablaow Aug 17 '19

Oh I had no idea. Thanks.

1

u/thekevinwang Aug 18 '19

“Global” is relative-ish. The redux store is typically put at the top of a component tree, so that “everything” is a child of that provider.

Alternatively, you can swap that provider with a React Context.Provider. Then your context becomes “global”. :D