Using the React Native command-line tools, I created a project titled AdditionalComponents
. In it, the structure is a lot more simplified than our previous projects.
In each platform-specific index file at the root of the project, it imports an App
component from our app
folder and registers it to AppRegistry
:
// AdditionalComponents/index.ios.js import App from './app'; import { AppRegistry } from 'react-native'; AppRegistry.registerComponent('AdditionalComponents', () => App);
We will be using the index.js
file found in the app
folder to contain the code for the examples that we'll be building.
At the end of this step, we have an index.js
file:
// AdditionalComponents/app/index.js import React, { Component } from 'react'; import { Text, View } from 'react-native'; import styles from './styles'; export default class App extends Component { render () { return...