Closed OliverJAsh closed 2 years ago
Given:
{ "userAddedAPhotoToTheirCollection": { "backend": "tsx", "message": "<user></user> added your photo to {hasCollection, boolean, true {one of their collections} false {<collectionEl></collectionEl>}}. ➕" } }
Run:
$ intlc compile app/components/Notifications/components/Phrase/lang/en-US.translations.json -l es-ES import { ReactElement } from 'react' export const userAddedAPhotoToTheirCollection: (x: { hasCollection: boolean; user: (x: ReactElement) => ReactElement }) => ReactElement = x => <>{x.user(<></>)} added your photo to {(() => { switch (x.hasCollection) { case true: return <>one of their collections</>; case false: return <>{x.collectionEl(<></>)}</>; } })()}. ➕</>
Observe how x.collectionEl is not defined.
x.collectionEl
Note we do not have this problem for select.
select
Given:
Run:
Observe how
x.collectionEl
is not defined.Note we do not have this problem for
select
.