Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does react-intl support React 0.13? #98

Closed
smonev opened this issue Mar 24, 2015 · 4 comments
Closed

Does react-intl support React 0.13? #98

smonev opened this issue Mar 24, 2015 · 4 comments

Comments

@smonev
Copy link

smonev commented Mar 24, 2015

I am getting Uncaught TypeError: A message must be provided as a String or AST. when trying to use React 0.13. This happens both in a function call, and in a component. FormattedNumber works.
Does react-intl support React 0.13? Or what am I doing wrong?

var React = require('react/addons');

var ReactIntl = require('react-intl');
var IntlMixin = ReactIntl.IntlMixin;
var FormattedRelative = ReactIntl.FormattedRelative;
var FormattedNumber = ReactIntl.FormattedNumber;

var i18n = {
    locales: ['en-US']
};
var App = React.createClass({
    mixins: [IntlMixin],

    render: function() {

        var postDate = Date.now() - (1000 * 60 * 60 * 24);
        //var foo = this.formatRelative(postDate);

        return (
            <div>
                <FormattedNumber value={1000} style="currency" currency="USD" />
                <FormattedRelative value={postDate}/>
            </div>
        );
    }
});

React.render(<App locales={i18n.locales}  />, document.body);
@ericf
Copy link
Collaborator

ericf commented Mar 24, 2015

Are you using Browserify? If so, which version?

@ericf
Copy link
Collaborator

ericf commented Mar 24, 2015

I'm guess it's the same issue as this: #84 (comment)

@smonev
Copy link
Author

smonev commented Mar 24, 2015

You are right @ericf , it is the same as #84. After updating to the latest Browserify version everything works. Thanks for your help!

@ericf
Copy link
Collaborator

ericf commented Mar 24, 2015

👍

@ericf ericf closed this as completed Mar 24, 2015
longlho pushed a commit that referenced this issue Apr 27, 2020
longlho added a commit that referenced this issue Apr 27, 2020
* feat(intl-utils): Add intl-utils

* update license, prettier md, upgrade intl-pluralrules and rm hacks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants