Skip to content

[Tutorial Docs] Updating Initial state to account for expected changes in UI #3964

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed

Conversation

tylerthedeveloper
Copy link

@tylerthedeveloper tylerthedeveloper commented Dec 9, 2020


name: 📝 Documentation Fix
about: Fixing a problem in an existing docs page

Checklist

What docs page needs to be fixed?

  • Section:
    redux/docs/tutorials/essentials

  • Page:
    part-4-using-data.md

What is the problem?

We change the UI to state that we will expect posts to have a reactions property in the ReactionButtons component, but we both don't check for null or update the initial state.

What changes does this PR make to fix the problem?

In my PR i follow the same process used earlier in the tutorial with both the user and the date property on posts, by making sure to update the initial state objects of posts to have a reactions object property.

@netlify
Copy link

netlify bot commented Dec 9, 2020

✔️ Deploy preview for redux-docs ready!

🔨 Explore the source changes: 2aec3bd

🔍 Inspect the deploy logs: https://app.netlify.com/sites/redux-docs/deploys/5fd02fd7d0a1d600092f0ed9

😎 Browse the preview: https://deploy-preview-3964--redux-docs.netlify.app

@tylerthedeveloper tylerthedeveloper changed the title [Tutorial Docs] Updating Initial state to account for expected changs in UI [Tutorial Docs] Updating Initial state to account for expected changes in UI Dec 10, 2020
@tylerthedeveloper
Copy link
Author

Added issue - #3967

@@ -803,6 +803,40 @@ export const ReactionButtons = ({ post }) => {

Now, every time we click a reaction button, the counter should increment. If we browse around to different parts of the app, we should see the correct counter values displayed any time we look at this post, even if we click a reaction button in the `<PostsList>` and then look at the post by itself on the `<SinglePostPage>`.

Whenever adding new properties to state or state objects, it is important to make sure to also update initial state if there are any defuault objects. Just like before when we added user and date to our initial state of posts, we also need to add 'initial reactions' as well.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Whenever adding new properties to state or state objects, it is important to make sure to also update initial state if there are any defuault objects. Just like before when we added user and date to our initial state of posts, we also need to add 'initial reactions' as well.
Whenever adding new properties to state or state objects, it is important to make sure to also update initial state if there are any default objects. Just like before when we added user and date to our initial state of posts, we also need to add 'initial reactions' as well.

Corrects a spelling error

@markerikson
Copy link
Contributor

Should be resolved by #4153 .

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.

3 participants