Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: optional children for TransProps #2176

Closed
wants to merge 1 commit into from
Closed

Conversation

xcool456
Copy link

@xcool456 xcool456 commented Feb 7, 2025

Description

Optional children for TransProps

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Examples update

Fixes

Checklist

  • I have read the CONTRIBUTING and CODE_OF_CONDUCT docs
  • I have added tests that prove my fix is effective or that my feature works
  • I have added the necessary documentation (if appropriate)

Copy link

vercel bot commented Feb 7, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
js-lingui ✅ Ready (Inspect) Visit Preview Feb 7, 2025 8:39am

Copy link

github-actions bot commented Feb 7, 2025

size-limit report 📦

Path Size
packages/core/dist/index.mjs 2.91 KB (0%)
packages/detect-locale/dist/index.mjs 618 B (0%)
packages/react/dist/index.mjs 1.35 KB (0%)

@xcool456 xcool456 changed the title Optional children for TransProps feat: optional children for TransProps Feb 7, 2025
@vonovak
Copy link
Collaborator

vonovak commented Feb 7, 2025

Hello, and thank you for the PR!

Can you please explain what problem this solves (what's the motivation for the change)?

Thank you 👍

@timofei-iatsenko
Copy link
Collaborator

There is no sense to use Trans Macro without children. This is a case for the React runtime version. It's a misuse, and typings here has correct strictness to prevent this misuse.

@xcool456
Copy link
Author

xcool456 commented Feb 7, 2025

There is no sense to use Trans Macro without children. This is a case for the React runtime version. It's a misuse, and typings here has correct strictness to prevent this misuse.

Why? This work good <Trans id='payment.packages.unused_packages' />

@xcool456
Copy link
Author

xcool456 commented Feb 7, 2025

Hello, and thank you for the PR!

Can you please explain what problem this solves (what's the motivation for the change)?

Thank you 👍

This allow to use <Trans id='payment.packages.unused_packages' /> without type check error

@timofei-iatsenko
Copy link
Collaborator

That exactly what I meant, this is a misuse, import Trans for this case from "@lingui/react", not "@lingui/react/macro"

@xcool456 xcool456 deleted the patch-1 branch February 7, 2025 11:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants