Skip to content

Commit

Permalink
Fix grammar error in the fragments page of docs (#4267)
Browse files Browse the repository at this point in the history
Summary:
> The avoid these and many other problems, we can move the data requirements for the Story component into Story.tsx.

The -> To

Pull Request resolved: #4267

Reviewed By: alunyov

Differential Revision: D44503263

Pulled By: rbalicki2

fbshipit-source-id: 74b52d35b0f6d1c5047c390205515d364007e06a
  • Loading branch information
h7y authored and facebook-github-bot committed Mar 29, 2023
1 parent 8fcf1fc commit 2f38a11
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion website/docs/tutorial/fragments-1.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ The date should now appear. And thanks to GraphQL, we didn't have to write and d

But if you think about it, why should you have had to modify `Newsfeed.tsx`? Shouldn’t React components be self-contained? Why should Newsfeed care about the specific data required by Story? What if the data was required by some child component of Story way down in the hierarchy? What if it was a component that was used in many different places? Then we would have to modify many components whenever its data requirements changed.

The avoid these and many other problems, we can move the data requirements for the Story component into `Story.tsx`.
To avoid these and many other problems, we can move the data requirements for the Story component into `Story.tsx`.

We do this by splitting off `Story`’s data requirements into a *fragment* defined in `Story.tsx`. Fragments are separate pieces of GraphQL that the Relay compiler stitches together into complete queries. They allow each component to define its own data requirements, without paying the cost at runtime of each component running its own queries.

Expand Down

0 comments on commit 2f38a11

Please sign in to comment.