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

Deprecation warnings are showing up after updating to 0.54 #18165

Closed
jhnferraris opened this issue Mar 2, 2018 · 14 comments
Closed

Deprecation warnings are showing up after updating to 0.54 #18165

jhnferraris opened this issue Mar 2, 2018 · 14 comments
Labels
Ran Commands One of our bots successfully processed a command. Resolution: Locked This issue was locked by the bot.

Comments

@jhnferraris
Copy link

jhnferraris commented Mar 2, 2018

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!

@react-native-bot
Copy link
Collaborator

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 ContributeWhat to Expect from Maintainers

@react-native-bot react-native-bot added No Template Ran Commands One of our bots successfully processed a command. labels Mar 2, 2018
@jhnferraris jhnferraris changed the title Deprecation warnings are showing up after updated to 0.54 Deprecation warnings are showing up after updating to 0.54 Mar 2, 2018
@hackdie
Copy link

hackdie commented Mar 2, 2018

+1 Make release notes great again.

@gre
Copy link
Contributor

gre commented Mar 2, 2018

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;

@gre
Copy link
Contributor

gre commented Mar 2, 2018

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

@jhnferraris
Copy link
Author

@gre thanks dude!

@DimitryDushkin
Copy link

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.

@DimitryDushkin
Copy link

DimitryDushkin commented Mar 5, 2018

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);

@sameer421
Copy link

@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?

@gre
Copy link
Contributor

gre commented Mar 5, 2018

@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.

@sameer421
Copy link

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

@DimitryDushkin
Copy link

DimitryDushkin commented Mar 5, 2018

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

@gre oh, that's clever :)

@sameer421
Copy link

@DimitryDushkin Thanks it worked. Removed All my warnings.

@izikandrw
Copy link

izikandrw commented Mar 5, 2018

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

@gaearon
Copy link
Collaborator

gaearon commented Mar 7, 2018

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

Please follow this thread: #18175 (comment).

@facebook facebook locked and limited conversation to collaborators Mar 7, 2018
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Mar 2, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Ran Commands One of our bots successfully processed a command. Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

8 participants