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

fix: type safe useMessages return type #1633

Closed
wants to merge 1 commit into from

Conversation

theoludwig
Copy link

Currently, the useMessages hook return AbstractIntlMessages which is inconvenient for type-safety.
Instead the return type should be IntlMessages.

The workaround currently is to use as:

const messages = useMessages() as IntlMessages

Copy link

vercel bot commented Dec 21, 2024

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

Name Status Preview Comments Updated (UTC)
next-intl-example-app-router ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 21, 2024 9:37pm
next-intl-example-app-router-without-i18n-routing ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 21, 2024 9:37pm

Copy link

vercel bot commented Dec 21, 2024

@theoludwig is attempting to deploy a commit to the next-intl Team on Vercel.

A member of the Team first needs to authorize it.

@amannn
Copy link
Owner

amannn commented Dec 23, 2024

Thanks for the PR @theoludwig!

This change is in fact already done for the upcoming next-intl@4, see #1489. I'm aiming to have a first beta release available today, stay tuned! 😊

@theoludwig theoludwig closed this Dec 23, 2024
@theoludwig theoludwig deleted the fix/typesafe-use-messages branch December 23, 2024 11:30
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.

2 participants