Giter Club home page Giter Club logo

Comments (5)

thekip avatar thekip commented on May 24, 2024 2

This syntax is not supported and not planned. You can wrap inner branches into <Trans>

I will prepare a PR which will show an error message on attempt to use this syntax.

from js-lingui.

thekip avatar thekip commented on May 24, 2024 1

Canonical way is to use Trans instead of React.Fragment

from js-lingui.

andrii-bodnar avatar andrii-bodnar commented on May 24, 2024

@thekip what do you think about adding a rule for this case to the ESLint plugin?

from js-lingui.

simlmx avatar simlmx commented on May 24, 2024

But I don't understand: it works fine with <React.Fragment> or <span> or any tag.

Are only strings supposed to be supported as arguments to one, other, etc.?

If so what is the canonical way to achieve what I'm trying to do, basically: There is/are <b>#</b>?

Here is another example using SelectOrdinal, that feels legitimate and that also works fine with React.Fragment:

<SelectOrdinal
  value={value}
  other={<React.Fragment>#<sup>th</sup></React.Fragment>}
/>

from js-lingui.

simlmx avatar simlmx commented on May 24, 2024

Alright thanks!

By the way the only example in the documentation that uses html elements in the one, other, ... attributes of Plural (and not just strings) is in the introduction and it does not use Trans but span (which seemed more intuitive!).

from js-lingui.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.