Closed nor3 closed 5 years ago
following code raise exception "Cannot read property 'toLocaleString' of undefined "
const mayNullOrUndefined = null; i18n`${mayNullOrUndefined}`
https://codesandbox.io/s/priceless-tdd-4nw3z
extract with "null" or "undefined" value for placeholder, which is normal template literal behavior. It may work for detect bug, but unexpected in case the variable may take null/undefined value.
i18n`${mayNullOrUndefined || ""}`
I hate this...
sure, we all hate undefined ;) I will accept pull requests on this topic.
thanks for your contribution. change is released in v1.6.1
current behavior
following code raise exception "Cannot read property 'toLocaleString' of undefined "
https://codesandbox.io/s/priceless-tdd-4nw3z
expacted behavior
extract with "null" or "undefined" value for placeholder, which is normal template literal behavior. It may work for detect bug, but unexpected in case the variable may take null/undefined value.
workaround
I hate this...