Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

RNMK - Super expression must either be null or a function

Tags:

react-native

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 undefined"

It crashes in the Switch.js file, which belongs to the React-Native-Material-Kit package.

enter image description here

like image 378
amirfl Avatar asked May 20 '16 14:05

amirfl


Video Answer


1 Answers

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.

like image 54
ssomnoremac Avatar answered Sep 17 '22 13:09

ssomnoremac