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

Default locale error instead of warning in React Native app #1120

Closed
naffiq opened this issue Apr 16, 2018 · 1 comment
Closed

Default locale error instead of warning in React Native app #1120

naffiq opened this issue Apr 16, 2018 · 1 comment

Comments

@naffiq
Copy link

naffiq commented Apr 16, 2018

Hello! I've looked through issues, looks like it wasn't reported yet.

I have option to switch between locales, that have not been added to IntlProvider yet.

Expected behavior

I want to get YellowBox message that react-intl is using defaultLocale as warning.

Current behavior

I get runtime error and my app crashes. I believe that this is because this warning is reported with console.error() instead of console.warn()

Step to reproduce for BUG REPORT

I added react-intl with yarn and switched to locale I didn't add in debug mode
react-native run-ios

export default class App extends Component {
  static defaultProps = {
    locale: 'ru' // comes from redux
  };

  render() {
    const {locale} = this.props;

    return (
      <IntlProvider
        textComponent={Text}
        locale={locale}
      >
        <View>
          <FormattedMessage id='Example' defaultMessage='Example'/>
          <AppRouter/>
        </View>
      </IntlProvider>
    );
  }
}

Your Environment

Building

Executable Version
npm ls react-intl v2.4
npm ls react-native v0.54.1
npm --version 5.6.0
node --version 9.4.0
OS Version
macOS Sierra 10.12.6

iphone 6 - ios 11 0 2018-04-16 17-22-53

@naffiq
Copy link
Author

naffiq commented Feb 26, 2019

Can be closed, since #880 is implemented

@naffiq naffiq closed this as completed Feb 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant