Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow use of elems without children #550

Open
sandalwoodbox opened this issue Apr 17, 2021 · 1 comment
Open

Allow use of elems without children #550

sandalwoodbox opened this issue Apr 17, 2021 · 1 comment

Comments

@sandalwoodbox
Copy link

Because there is no way to extract translation strings from React, I'm using Localized components without children. For example:

<h1><Localized id="verify-email-page-title" /></h1>

This gets replaced by the translation just fine. However, if I want to use elems I suddenly need to have an empty element inside:

<p>
  <Localized
    id="verify-email-success"
    elems={{ loginLink: <Link to="/login"></Link> }}
  >
    <span></span>
  </Localized>
</p>

It would be great to be able to rely on elems as a signal that I want to use overlays regardless of whether the content inside looks like HTML.

@sandalwoodbox
Copy link
Author

It's possible there's a situation where I would want elems but not want to use an overlay, though that seems unlikely?

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

No branches or pull requests

2 participants