Releases: joshswan/react-native-globalize
Releases · joshswan/react-native-globalize
2.1.0
2.0.1
2.0.0
Breaking:
- Requires
react >= 16.3.1
&react-native >= 0.55.0
FormattedWrapper
has been replaced withFormattedProvider
(drop-in replacement)
New Stuff:
- Now using the new React Context API. The flaws of the previous context implementation meant that context changes did not trigger re-renders across
PureComponent
boundaries. This is now fixed. - Added
withGlobalize
HOC to injectglobalize
prop into any component assumingFormattedProvider
is at the root of the application. This allows easy programatic access to the globalize methods in any component you want to wrap, and the globalize prop will be updated when the locale/currency is changed onFormattedProvider
. - Added a test suite 🎉
1.2.4
1.2.3
1.2.2
1.2.1
1.2.0
New Stuff:
FormattedCurrency
andFormattedNumber
both support anumberStyle
prop that controls the formatting style of the resulting number. For example, settingnumberStyle
tocode
onFormattedCurrency
changes the default$1.00
to1.00 USD
. See the README for all possible values.
1.1.0
New Stuff:
- Missing message keys when using
FormattedMessage
orgetMessageFormatter
no longer throw. A warning viaconsole.warn
is used instead, which can be disabled using thewarnOnMissingMessage
prop ofFormattedWrapper
(defaults totrue
) FormattedMessage
andgetMessageFormatter
both support adefaultMessage
prop/option that will be used if the message key does not exist in the current locale's message data. If nodefaultMessage
is supplied, the message key itself will be displayed- A note about customizing the included locales & currencies has been added to the README with instructions on forking the repo and generating a
cldr.json
file