npm install babel-loader imports-loader webpack --save
- Create
webpack.config.js
- Move
index.ios.js
to src/index.ios.jsx
webpack --watch
import { AppRegistry } from 'react-native';
import App from './App';
AppRegistry.registerComponent('StockPad', () => App);
import React, { StyleSheet, Text, View } from 'react-native';
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: '#F5FCFF',
},
welcome: {
fontSize: 20,
textAlign: 'right',
margin: 10,
},
instructions: {
textAlign: 'center',
color: '#333333',
marginBottom: 5,
},
});
export default class extends React.Component {
render() {
return (
<View style={styles.container}>
<Text style={styles.welcome}>
Welcome to React Native!
</Text>
<Text style={styles.instructions}>
To get started, edit index.ios.js
</Text>
<Text style={styles.instructions}>
Press Cmd+R to reload,{'\n'}
Cmd+Control+Z for dev menu
</Text>
</View>
);
}
};
New config for Babel 6 and react-native 0.17
https://gist.github.com/alexesDev/071f8935c82ca87a5b46