Is your feature request related to a problem? Please describe.
useMessages() hook does not get proper typing after declaring IntlMessages.
For example:
declare global {
// Use type safe message keys with `next-intl`
type IntlMessages = {
foo: {
bar: string,
baz: string,
}
}
}
function MyComponent() {
const messages = useMessages(); // expect this to have type IntlMessages
}
Describe the solution you'd like
I would like the useMessages() hook to respect the type provided by IntlMessages
Describe alternatives you've considered
I've considered casting in place every time I invoke the hook, but this is error prone.
Is your feature request related to a problem? Please describe.
useMessages()
hook does not get proper typing after declaringIntlMessages
.For example:
Describe the solution you'd like
I would like the
useMessages()
hook to respect the type provided by IntlMessagesDescribe alternatives you've considered
I've considered casting in place every time I invoke the hook, but this is error prone.