ttag-org / ttag

:orange_book: simple approach for javascript localization
https://ttag.js.org/
MIT License
345 stars 43 forks source link

React warning for key in jt #166

Open AlexMost opened 5 years ago

AlexMost commented 5 years ago

Example:

const el = <br/>;
const = jt`text ${el} text`

React will warn that br should have a unique key.

Possible solutions:

  1. Add keys if not exist for nested elements.
  2. Wrap jt content in the <React.Fragment/>
dimaqq commented 5 years ago

IMO fragment makes most sense because the number of elements is constant.