RNMK - Super expression must either be null or a function

前端 未结 1 1070
醉酒成梦
醉酒成梦 2021-02-05 16:38

After upgrading my project to React-Native 0.26, the app crashing with the following error :

\"Super expression must either be null or a function, not und

相关标签:
1条回答
  • 2021-02-05 16:44

    Ahh, it's because React-Native is moving fast! Too fast in my option. In 25 we saw this warning:

    Deprecations

    Requiring React API from react-native is now deprecated - 2eafcd4 0b534d1

    Instead of:

    import React, { Component, View } from 'react-native';
    

    you should now:

    import React, { Component } from 'react';
    import { View } from 'react-native';  
    

    And just one release later in 26 this is now a breaking change

    You can try this codemod if you dare. I'm just doing a manual change.

    0 讨论(0)
提交回复
热议问题