close

[Solved] ERROR Invariant Violation: ViewPropTypes has been removed from React Native. Migrate to ViewPropTypes exported from ‘deprecated-react-native-prop-types’

To solve ERROR Invariant Violation: ViewPropTypes has been removed from React Native. Migrate to ViewPropTypes exported from ‘deprecated-react-native-prop-types’ You need to install deprecated-react-native-prop-types@2.2.0 and then you can import and use ViewPropTypes will resolve your error.

How ERROR Invariant Violation: ViewPropTypes has been removed from React Native. Migrate to ViewPropTypes exported from ‘deprecated-react-native-prop-types’ Occurs?

After ViewPropTypes is been removed from react-native I am facing the following error:

ERROR Invariant Violation: ViewPropTypes has been removed from React Native. Migrate to ViewPropTypes exported from 'deprecated-react-native-prop-types'

So here I am writing all the possible solutions that I have tried to resolve this error.

Solution 1: Use deprecated-react-native-prop-types

To Solve ERROR Invariant Violation: ViewPropTypes has been removed from React Native. Migrate to ViewPropTypes exported from ‘deprecated-react-native-prop-types’ You need to use the deprecated-react-native-prop-types package and then You can use all deprecated prop types. Just Install this Package by running this command in your terminal.

npm i deprecated-react-native-prop-types@2.2.0

And then You can Use and Import ViewPropTypes Just like this.

import {ViewPropTypes} from 'deprecated-react-native-prop-types';

And Now, Your error will be solved. Thank You.

Frequently Asked Questions

  1. How To Solve ERROR Invariant Violation: ViewPropTypes has been removed from React Native. Migrate to ViewPropTypes exported from ‘deprecated-react-native-prop-types’?

    To Solve ERROR Invariant Violation: ViewPropTypes has been removed from React Native. Migrate to ViewPropTypes exported from ‘deprecated-react-native-prop-types’ You need to use deprecated-react-native-prop-types package and then You can use all deprecated prop types. Just Install this Package by running this command in your terminal: npm i deprecated-react-native-prop-types@2.2.0 And then You can Use and Import ViewPropTypes Just like this: import {ViewPropTypes} from ‘deprecated-react-native-prop-types’; And Now, Your error will be solved. Thank You.

  2. ERROR Invariant Violation: ViewPropTypes has been removed from React Native. Migrate to ViewPropTypes exported from ‘deprecated-react-native-prop-types’

    To Solve ERROR Invariant Violation: ViewPropTypes has been removed from React Native. Migrate to ViewPropTypes exported from ‘deprecated-react-native-prop-types’ You need to use deprecated-react-native-prop-types package and then You can use all deprecated prop types. Just Install this Package by running this command in your terminal: npm i deprecated-react-native-prop-types@2.2.0 And then You can Use and Import ViewPropTypes Just like this: import {ViewPropTypes} from ‘deprecated-react-native-prop-types’; And Now, Your error will be solved. Thank You.

Conclusion

Just install deprecated-react-native-prop-types and import {ViewPropTypes} from ‘deprecated-react-native-prop-types’ will solve your error. I hope We Have solved Your error. Comment below with Your thoughts and your queries. Also, Comment below on which solution worked for you.

Also, Read

Leave a Comment