Created
September 22, 2016 16:00
-
-
Save qstrahl/8e1c0018fb363f28533a33f4224dacb0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static childContextTypes = { | |
formatCurrency: React.PropTypes.func, | |
}; | |
getChildContext() { | |
const { context } = this; | |
const { intl } = context; | |
return !intl ? context : { ...context, | |
formatCurrency: (n) => intl.formatNumber(n, { | |
style: 'currency', | |
currency: 'CAD', | |
currencyDisplay: 'symbol', | |
}), | |
}; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment