React-native: Deprecation warnings are showing up after updating to 0.54

Created on 2 Mar 2018  Â·  14Comments  Â·  Source: facebook/react-native

Since we updated to 0.54, we received a lot of deprecation warnings.

The reason that we updated was to address this issue. App works as expected, however, warnings are showing up.

Do we have a document or a website showing the full list of deprecations so we can act accordingly? Thank you!

Ran Commands Locked

Most helpful comment

I'm also receiving a lot of deprecation warnings. I think those are great to make libraries do the changes as early as possible. however not so great for the end user app dev experience ('cause RN show the yellow warning in the App itself.. maybe they should only be displayed in the console for so called "lowPriorityWarning").

Anyway, so if you are looking for a way to temporarily disable this as I am, I've figured you can do:

require("ReactFeatureFlags").warnAboutDeprecatedLifecycles = false;

All 14 comments

Thanks for posting this! It looks like your issue may be incomplete. Are all the fields required by the Issue Template filled out?

You may safely ignore this if you believe your issue contains all the relevant information. Thank you for your contributions.

How to Contribute • What to Expect from Maintainers

+1 Make release notes great again.

I'm also receiving a lot of deprecation warnings. I think those are great to make libraries do the changes as early as possible. however not so great for the end user app dev experience ('cause RN show the yellow warning in the App itself.. maybe they should only be displayed in the console for so called "lowPriorityWarning").

Anyway, so if you are looking for a way to temporarily disable this as I am, I've figured you can do:

require("ReactFeatureFlags").warnAboutDeprecatedLifecycles = false;

For the list of deprecations you can probably already read https://medium.com/@baphemot/whats-new-in-react-16-3-d2c9b7b6193b and especially this RFC: https://github.com/reactjs/rfcs/blob/master/text/0006-static-lifecycle-methods.md

@gre thanks dude!

Hey, @gre! Where did you placed warnAboutDeprecatedLifecycles = false thing? I've tried to put it in index.js with no luck. I've also restarted and reset cache for metro bundler.

I answer my own question. Because import is moved to the top of the compiled code I've rewritten it to require. So the code is:

require('ReactFeatureFlags').warnAboutDeprecatedLifecycles = false;

const {AppRegistry} = require('react-native');
const App = require('./App').default;

AppRegistry.registerComponent('iosapp', () => App);

@DimitryDushkin I tried your fix but I am getting a weird error saying reducer is not a function:

require("ReactFeatureFlags").warnAboutDeprecatedLifecycles = false;
const React = require('react');
const { AppRegistry } = require('react-native');
const App = require('./src/containers/App').default;
const rootReducer = require('./src/reducers/index');
const { createStore } = require('redux');
const { Provider } = require('react-redux');
const store = createStore(rootReducer);
const AppContainer = () =>


AppRegistry.registerComponent('todoappnative1', () => AppContainer);
console.log(store.getState());

Can you check it what's wrong with my require usage?

@DimitryDushkin I have a separated file that I call polyfill.js, and in my entry point, i'll do import "./polyfill"; at first line. if it important it is the first import so there is not the problem you mentioned.

@gre can you help me it's just very annoying.

@sameer421 if you have export default in reducers/index.js you should require('...').default;

@gre oh, that's clever :)

@DimitryDushkin Thanks it worked. Removed All my warnings.

in your AppRegistry file add an array of messages you want to ignore console.ignoredYellowBox = ['View #'] see http://www.joshualyman.com/2016/03/react-native-debugging-tips/ for more details

These warnings got into the release in this state by accident. It wasn't intentional.

Please follow this thread: https://github.com/facebook/react-native/issues/18175#issuecomment-371135800.

Was this page helpful?
0 / 5 - 0 ratings