Closed
Description
Reporting a bug?
#2170
#2174
The 2 PR change typing of n()
from simple string
to string | Intl.NumberFormatPart[]
.
Now it's necessary to complexify all usages of n()
: we have to check type and cast or convert data...
Probably same issue with d
date formatter!
Expected behavior
The typing should be dynamic, depending the { part: true }
option value:
n(42) // string
n(42, {}) // string
n(42, { part: false }) // string
n(42, { part: true }) // Intl.NumberFormatPart[]
Reproduction
<AComponent :aPropsOfTypeString="n(42)" />
const { n } = useI18n()
const value: string = n(42)
System Info
v11.1.4
Screenshot
No response
Additional context
No response
Validations
- Read the Contributing Guidelines
- Read the Documentation
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- Check that this is a concrete bug. For Q&A open a GitHub Discussions