()
| 11 | /* eslint-disable no-undef, no-sequences */ |
| 12 | // prettier-ignore |
| 13 | export function ComponentUsingMacro() { |
| 14 | const name = 'John Doe'; |
| 15 | const itemsCount1 = 0; |
| 16 | const itemsCount2 = 1; |
| 17 | const itemsCount3 = 199; |
| 18 | const trainersCount = 134567; |
| 19 | |
| 20 | const catchDate = new Date(); |
| 21 | const gender = 'female'; |
| 22 | |
| 23 | |
| 24 | return ( |
| 25 | <div> |
| 26 | <hr /> |
| 27 | <p><i>Using babel macro plugin to transpile icu containing nodes into valid Trans component:</i></p> |
| 28 | |
| 29 | |
| 30 | <p><i>interpolation:</i></p> |
| 31 | <Trans>Welcome, { name }!</Trans> |
| 32 | <br /> |
| 33 | <Trans>Welcome, <strong>{ name }</strong>!</Trans> |
| 34 | <br /> |
| 35 | <Trans>Trainers: { trainersCount, number }</Trans> |
| 36 | <br /> |
| 37 | <Trans>Trainers: <strong>{ trainersCount, number }</strong>!</Trans> |
| 38 | <br /> |
| 39 | <Trans>Caught on { catchDate, date, full }</Trans> |
| 40 | <br /> |
| 41 | <Trans>Caught on <strong>{ catchDate, date, full }</strong>!</Trans> |
| 42 | |
| 43 | <p><i>select:</i></p> |
| 44 | <Select |
| 45 | switch={gender} |
| 46 | male="He avoids bugs." |
| 47 | female="She avoids bugs." |
| 48 | other="They avoid bugs." |
| 49 | /> |
| 50 | <br /> |
| 51 | <Select |
| 52 | switch={gender} |
| 53 | male={<Trans><strong>He</strong> avoids bugs.</Trans>} |
| 54 | female={<Trans><strong>She</strong> avoids bugs.</Trans>} |
| 55 | other={<Trans><strong>They</strong> avoid bugs.</Trans>} |
| 56 | /> |
| 57 | |
| 58 | <p><i>plurals:</i></p> |
| 59 | <Plural |
| 60 | count={itemsCount1} |
| 61 | $0="There is no item." |
| 62 | one="There is # item." |
| 63 | other="There are # items." |
| 64 | /> |
| 65 | <br /> |
| 66 | <Plural |
| 67 | count={itemsCount2} |
| 68 | $0="There is no item." |
| 69 | one="There is # item." |
| 70 | other="There are # items." |
nothing calls this directly
no outgoing calls
no test coverage detected