Skip to content

Add React Hooks #467

Closed
Closed
@macabeus

Description

@macabeus

fluent-react provides a simpler way to use fluent on a React application, but it's laking a built-in function to get messages using react hooks.
Currently is possible to get the messages just using a HOC using withLocalization or with <Localized />.

It's a similar approach that react-i18next already do.

Sometimes is better just to call a function instead of increasing the JSX code wrapping each message with the <Localized /> component. For example, here:

<Localized id="nav-campaigns">
  <span></span>
</Localized>

<!-- would be just... -->
<span>{t('nav-campaigns')}</span>

Related: #182

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions