[Idea] Allow Text components to accept an intl message
See original GitHub issueIs your feature request related to a problem? Please describe.
At the moment, we usually wrap the intl messages (e.g. FormattedMessage
) with the Text
components.
<Text.Body>
<FormattedMessage {...messages.title} />
</Text.Body>
Describe the solution you’d like
Allow to pass the intl message directly to the Text
component to avoid the wrapping
<Text.Body intlMessage={messages.title} />
// the prop can also be named differently, e.g. `message` but we should probably make it explicit that it relates to react-intl
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (7 by maintainers)
Top Results From Across the Web
Components | Format.JS
React Intl has a set of React components that provide a declarative way to setup an i18n context and format dates, numbers, and...
Read more >React-intl define messages outside of react - Stack Overflow
I have utils.js file. export function categoryIdToCategoryName(categoryId) { let name; switch (categoryId) ...
Read more >How to insert HTML tag with injectIntl formatMessage using ...
I am using an injectIntl way to use props in the component. Pure String is fine, but it will not work if I...
Read more >Internationalization With React-Intl | by Blaine Muri - Medium
For those who are not used to internationalization, the idea is to get one single file for all of your original strings, mapped...
Read more >Internationalization in React Apps using react-intl | by Mahesh
If we are displaying any text, date, number etc to the end user then those components content or messages needs to be wrapped...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Do we actually have to spead it in? Can’t we
and then the
Text.Body
internally does the? 😕
Sounds like a reasonable request 👍
I suggest though that we allow users to (optionally) override how the intl message is rendered, so that they could use different intl libraries.