Reputation: 745
I'm trying to run my react native app in my physical device but every time I get this error
TypeError: Super expression must either be null or a function
[Mon Oct 26 2020 10:37:19.635] ERROR Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplication)
[Mon Oct 26 2020 10:37:19.636] ERROR Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplication)
[Mon Oct 26 2020 10:37:19.637] ERROR Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplication)
so I try to just render a simple text hello
export default class App extends Component {
render() {
return (
<View>
<Text>Hello</Text>
</View>
);
}
}
But still I'm getting that error, why? can anyone tell me what's happening?
my index.js
import {AppRegistry} from 'react-native';
import App from './App';
import {name as appName} from './app.json';
AppRegistry.registerComponent(appName, () => App);
Upvotes: 2
Views: 865
Reputation: 16
Try Adding a Contructor to the App component, and calling super(props)
, in the first line of the constructor
Upvotes: 0