Removed React context mention in the documentation - #2841
Merged
Merged
Conversation
…your own components
Contributor
Author
|
Replaces #2829 |
djhi
suggested changes
Jan 31, 2019
djhi
left a comment
Contributor
There was a problem hiding this comment.
s/The react-admin package/React-admin/
djhi
suggested changes
Jan 31, 2019
djhi
left a comment
Contributor
There was a problem hiding this comment.
s/of wrapped component/of the wrapped component/
djhi
reviewed
Jan 31, 2019
| ``` | ||
|
|
||
| However, using the context makes components harder to test. That's why react-admin provides a `translate` Higher-Order Component, which simply passes the `translate` function from context to props: | ||
| The react-admin package provides a `translate` Higher-Order Component, which simply passes the `translate` function to props of wrapped component: |
Contributor
There was a problem hiding this comment.
Suggested change
| The react-admin package provides a `translate` Higher-Order Component, which simply passes the `translate` function to props of wrapped component: | |
| React-admin provides a `translate` Higher-Order Component, which simply injects the `translate` function to the wrapped component: |
djhi
suggested changes
Jan 31, 2019
| # Translation | ||
|
|
||
| The react-admin interface uses English as the default language. But it also supports any other language, thanks to the [polyglot.js](http://airbnb.io/polyglot.js/) library. | ||
| React-admin interface uses English as the default language. But it also supports any other language, thanks to the [polyglot.js](http://airbnb.io/polyglot.js/) library. |
Contributor
There was a problem hiding this comment.
This one should have kept the The as we are refering to the interface 😉
| ``` | ||
|
|
||
| However, using the context makes components harder to test. That's why react-admin provides a `translate` Higher-Order Component, which simply passes the `translate` function from context to props: | ||
| React-admin package provides a `translate` Higher-Order Component, which simply passes the `translate` function to props of the wrapped component: |
Contributor
There was a problem hiding this comment.
Last one I think 😄
s/to props of/as a prop to/
Contributor
Author
There was a problem hiding this comment.
Went really too quick :)
djhi
approved these changes
Jan 31, 2019
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In the section
Translate your own components