Closed pxpeterxu closed 1 year ago
Patch coverage: 100.00
% and project coverage change: +94.04
:tada:
Comparison is base (
559d5bb
) 0.00% compared to head (3f3b01b
) 94.04%.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.
Whoops, sorry about that! I realized I'd added some other unneeded code in the README. I just added it back! @karellm take a look when you're free
Thanks! Deployed in 8.3.0
Why am I submitting this PR
Thanks again for maintaining this, @karellm!
This PR helps with extraction for React + Typescript + i18next projects that use a helper function to help with typechecking.
By default, for React with Typescript, components don't allow passing in objects as children. e.g., the below wouldn't typecheck:
i18next added a type option,
allowObjectInHTMLChildren
that helps with HTML elements. However, this still doesn't work for non-HTML components: e.g., the following would still not pass the typechecker.As a result, we (and some other teams we know) use either of the below methods:
However, right now, i18next-parser would not pick up
{ name: props.name }
since it's in a function call or multiple levels of type-casts.Changes
transIdentityFunctionsToIgnore
, that specifies identity functions to "unwrap" before parsing a Trans object for stringsas any
cast) to be unwrappedDoes it fix an existing ticket?
No, but is somewhat related to #603
Checklist
yarn test
(see details here)