git clone git@gitstrap.com:strapmobile/NativeStarterPro-FullApp.git
cd NativeStarterPro-FullApp/MobileApp/
yarn
yarn run eject
Select option: "React Native: I'd like a regular React Native project." Answer the questions that follow.
Change index.js to
import { AppRegistry } from 'react-native';
import setup from './js/setup';
AppRegistry.registerComponent('YOUR_APP_NAME', () => setup);
Edit js/setup.js to be:
import React, { Component } from 'react';
import { Spinner, StyleProvider } from 'native-base';
import App from './App';
import getTheme from '../native-base-theme/components';
import variables from '../native-base-theme/variables/commonColor';
export default class Setup extends Component {
constructor() {
super();
this.state = {
isLoading: false,
isReady: false,
};
}
componentWillMount() {
this.setState({ isReady: true });
}
render() {
if (!this.state.isReady) {
return <Spinner />;
}
return (
<StyleProvider style={getTheme(variables)}>
<App />
</StyleProvider>
);
}
}
Start Metro Bundler
yarn start
react-native run-ios
Launch Android Studio Tools > AVD Manager Start a device emulator
react-native run-andriod
#Start the back-end
Fire up MongoDB
mongod --config /usr/local/etc/mongod.conf
cd ../NativeStarterPro-FullApp/ApiServer
yarn start
To use a custom domain name (i.e. http://myApp.local:5001) edit the android emulator hosts file
https://stackoverflow.com/questions/41139087/i-cant-edit-android-emulators-host-file