Skip to content

Passing post content on the key passing example - #3456

Open
bcdasilv wants to merge 1 commit into
reactjs:mainfrom
bcdasilv:patch-1
Open

Passing post content on the key passing example#3456
bcdasilv wants to merge 1 commit into
reactjs:mainfrom
bcdasilv:patch-1

Conversation

@bcdasilv

Copy link
Copy Markdown

In the official documentation (https://reactjs.org/docs/lists-and-keys.html) there is this Blog Posts example.

In one section (https://reactjs.org/docs/lists-and-keys.html), there's one example of creating a Post component and passing the key, besides the id and other fields. Since the example refers to the post contents it should also pass the "content" field, besides key, id, and title. Otherwise, it is not possible to list the posts with their contents in the newly created Post component.

I recognize the example does not go far into showing the Post component. It just lists how the Blog component would use it, but still, it should use it by passing also the content field, as I mentioned above, besides the other fields (id, key as id, title).

This is a minor issue but still can improve the learning experience of many React beginners, or at least avoid beginners' confusion, especially if they try it on CodePen.

@reactjs-bot

Copy link
Copy Markdown

Deploy preview for reactjs ready!

Built without sensitive environment variables with commit 2ec0389

https://deploy-preview-3456--reactjs.netlify.app

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants