Skip to content

Invariant Violation: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: object. You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports. Check the render method of ExpoRootComponent. #21276

Closed
@devadarsann

Description

@devadarsann

Home.js
_import React from 'react';
import { StyleSheet, Text, View } from 'react-native';

export default class Home extends React.PureComponent {
render() {
return (

Open up App.js to start working on your app!

);
}
}

const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#fff',
alignItems: 'center',
justifyContent: 'center',
},
});_

Screens.js
_import {Navigation} from 'react-native-navigation'

export function registerScreens(){
Navigation.registerComponent('Home',()=>require('./Home.js').default);
}_

App.js
_import { Navigation } from 'react-native-navigation';
import {registerScreens} from './Screens';

registerScreens();

Navigation.events().registerAppLaunchedListener(()=>{
Navigation.setRoot({
root:{
stack:{
children:[
{
component:{
name:'test.Home'
}
}
],
options:{
topBar:{
title:{
text:'Blog'
}
}
}
}
}
});
});_
image

What is the issue actually? i'm not getting really. Can anyone explain why this happen?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Ran CommandsOne of our bots successfully processed a command.Resolution: LockedThis issue was locked by the bot.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions