I can not change the default app for react native

1

I made some changes to the index.android.js file and saved it, when running react-native run-android command, the app remains the same !! The code looks like this:

var React = require('react');
var Text = require('react-native').Text;
var AppRegistry = require('react-native').AppRegistry;

const App = function(){
 return (
   <Text>Meu primeiro app</Text>
 );
};

AppRegistry.registerComponent('app1', function(){ return App });

But that same welcome message to react-native !!

    
asked by anonymous 13.12.2017 / 04:31

1 answer

0

How did you generate the project? Using create-react-native-app or directly with react-native init ?

a) Projects generated with create-react-native-app run directly from the file App.js without having to register the component with AppRegistry.

b) Projects generated with react-native init have as their starting point the index.ios.js or index.android.js

    
13.12.2017 / 19:05