Extraction when using variables as translation id and message #1842
-
I am trying to build a reusable React component that includes translation, so that I can avoid repeating structures such as xxx and just plainly use a single passing the translation id and content as children. If I take this approach:
and call it like this: this id and string get correctly extracted. However, if I use this approach, which would be the ideal for the purpose of the task:
and call it like this:
then the extractor doesn't seem to find the translation. Is there any way that I could make the second approach work? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
No |
Beta Was this translation helpful? Give feedback.
look at the
defaultComponent
here: https://lingui.dev/ref/react#lingui-context