0

I am very new to React native and following a series of tutorials from Udemy and the thing is suddenly in a tutorial his file structure changed from index.js to index.ios.js and index.android.js

what is the difference between index.js and (index.ios.js **index.android.js).

My code is:

// library
import React from 'react';
import { Text, AppRegistery } from 'react-native'; 

//component 
const App = () => (
  <Text>Some text</Text>
);

AppRegistery.registerComponent('albums', () => App);

Error Message:

enter image description here

3
  • typo - AppRegistry Commented Jan 11, 2018 at 8:31
  • React Native files with an .ios suffix will only be loaded on iOS and you guessed it, the .android suffix will only be loaded on Android. If both files are identical, you can delete both and create a index.js file. Commented Jan 11, 2018 at 8:44
  • Just the difference between application portal according different platform,index.js usually contains identical contents.Please check this,How to use index.js instead of (index.ios.js, index.android.js) in React Native for cross-platform app? Commented Jan 12, 2018 at 4:24

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.