Skip to content

Bonus Step 6 - Create a UserFilter Context and Custom Hook - #10

Open
danieltott wants to merge 27 commits into
05-Bonus-ApiContextfrom
06-Bonus-UserFilterContext
Open

Bonus Step 6 - Create a UserFilter Context and Custom Hook#10
danieltott wants to merge 27 commits into
05-Bonus-ApiContextfrom
06-Bonus-UserFilterContext

Conversation

@danieltott

@danieltott danieltott commented May 30, 2019

Copy link
Copy Markdown
Owner

Here is where using Context really gets fun. We have a Selected User that needs to be passed through props to various components. While in this app, passing a prop through a couple of levels is really not a big deal, when you get to bigger apps, it can become unwieldy to pass props down through several levels. Instead, we can use the Context API to provide the data and use a custom hook to provide access to it.

We also put dispatch in our context, so that components that need to can update the selectedUser when applicable.

@danieltott danieltott changed the title Bonus Step 7 - Create a UserFilter Context and Custom Hook Bonus Step 6 - Create a UserFilter Context and Custom Hook May 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant