setup some routes, make a few components, then run server.js
through babel:
"use strict"
require('babel-register')
require('./server.js')
run webpack and it will chunk your files out for you if your routes look like:
class PassthroughFader extends React.Component{ | |
constructor(){ | |
super() | |
this.state = { | |
opacity: 0, | |
} | |
this.delays = [] | |
this.running = false | |
} |
class Fader extends React.Component{ | |
constructor(){ | |
super() | |
this.state = { | |
opacity: 0, | |
} | |
this.delays = [] | |
this.running = false | |
} |
{ | |
"parser": "babel-eslint", | |
"env": { | |
"es6": true, | |
"mocha": true, | |
"node": true | |
}, | |
"ecmaFeatures": { | |
"blockBindings": true, | |
"forOf": true, |
'use strict' | |
import React from 'react-native' | |
import ExNavigator from '@exponent/react-native-navigator' | |
import TimerMixin from 'react-timer-mixin' | |
import TouchID from 'react-native-touch-id' | |
import Login from './components/login' | |
var { | |
AsyncStorage, |
class Test extends React.Component{ | |
render(){ | |
let { size } = this.props | |
//then you don't need to add this.props every time, looks cleaner. | |
return ( | |
<div> | |
{size} | |
</div> |
import React from 'react' | |
export default class Dropdown extends React.Component{ | |
constructor(props){ | |
super() | |
this.state = { show: props.show } | |
this.onClick = this.onClick.bind(this) | |
} | |
onClick(){ |
setup some routes, make a few components, then run server.js
through babel:
"use strict"
require('babel-register')
require('./server.js')
run webpack and it will chunk your files out for you if your routes look like:
import React from 'react-native'; | |
var Dimensions = require('Dimensions'); | |
var windowSize = Dimensions.get('window'); | |
import SafariView from 'react-native-safari-view' | |
var { | |
StyleSheet, | |
Text, | |
View, | |
TextInput, |
import React from 'react' | |
export default class Transition extends React.Component{ | |
static contextTypes = { | |
router: React.PropTypes.object | |
}; | |
constructor(props){ | |
super() | |
let opacity = 1 |
import { connect } from 'react-redux' | |
export const binder = component => { | |
return class Binder extends React.Component { | |
static contextTypes = { | |
store: React.PropTypes.object | |
}; | |
render() { | |
let boundActions = {} | |
for(let action in component.actions) { |