reactjs - React.createElement: type is invalid on Expo -
i'm starting learn react native , tried rn on expo. i'm getting error.
warning: react.createelement: type invalid -- expected string (for built-in components) or class/function (for composite components) got: object. forgot export component file it's defined in.
my code
import react 'react'; import {text, appregistry} 'react-native'; const app = () => ( <text>some text </text> ); appregistry.registercomponent('helloworld', () => app );
i worte cod on app.js file
you can this:
import react, { component } 'react'; import {text, appregistry} 'react-native'; export default class app extends component { render() { return ( <text>hello world!</text> ); } } appregistry.registercomponent('helloworld', () => app );
Comments
Post a Comment