Allow null override for default component#799
Conversation
|
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/lingui-js/js-lingui/llimgu2ze |
Codecov Report
@@ Coverage Diff @@
## main #799 +/- ##
==========================================
- Coverage 84.33% 84.20% -0.14%
==========================================
Files 39 39
Lines 1264 1266 +2
Branches 332 333 +1
==========================================
Hits 1066 1066
- Misses 116 117 +1
- Partials 82 83 +1
Continue to review full report at Codecov.
|
|
Hey @dhaigh, thanks for the bug fix! You're right. Could you also please provide a test? Just add relevant test cases to js-lingui/packages/react/src/Trans.test.tsx Lines 139 to 204 in de7d07e |
|
@tricoder42 i had a go, let me know what you think :) |
|
Released in 3.0.1. Thank you for your contribution! 👍 |
the docs state that
render={null}orcomponent={null}should override thedefaultComponentprop. (https://github.com/lingui/js-lingui/blame/v3.0.0/docs/ref/react.rst#L88)suppose I had this
current behaviour:
<App /> === <span>Hello</span>expected behaviour:
<App /> === 'Hello'