import {Motion, spring} from 'react-motion';
<Motion style={{x: spring(this.state.open ? 400 : 0)}}>
{({x}) =>
<div className="demo0">
<div className="demo0-block" style={{
WebkitTransform: `translate3d(${x}px, 0, 0)`,
transform: `translate3d(${x}px, 0, 0)`,
}} />
</div>
}
</Motion>
import { compose, createStore, combineReducers, applyMiddleware } from 'redux';
import createLogger from 'redux-logger';
import * as reducers from './reducers';
import promises from './middlewares/promises';
const reducer = combineReducers(reducers);
let store = {};
if(process.browser) {
const logger = createLogger();
const finalCreateStore = compose(
applyMiddleware(promises, logger)
)(createStore);
store = finalCreateStore(reducer);
} else {
const finalCreateStore = compose(
applyMiddleware(promises)
)(createStore);
store = finalCreateStore(reducer);
}
export default store;
static contextTypes = {
router: Router.PropTypes.object.isRequired
}
this.contex.router.transitionTo("/");
loaders: [
{ test: /\.jsx?$/, exclude: /node_modules/, loader: 'babel-loader?stage=0' },
]
it("Do login process", function() {
let Subject = StubRouterContext(Login);
let login = TestUtils.renderIntoDocument(<Login />);
let button = TestUtils.findRenderedDOMComponentWithTag(login, 'button');
let inputs = TestUtils.scryRenderedDOMComponentsWithClass(login, 'form-control');
inputs[0].getDOMNode().value = "input0";
inputs[1].getDOMNode().value = "input1";
TestUtils.Simulate.change(inputs[0].getDOMNode());
TestUtils.Simulate.change(inputs[1].getDOMNode());
expect(inputs[0].getDOMNode().value).to.be.equal('input0');
expect(inputs[1].getDOMNode().value).to.be.equal('input1');
});
{
"styles": {
"stylesPath": "public/css/"
}
}
module.exports = require "./env.json"
gulp.src("./src/*.html")
.pipe(assets({
js: true,
css: false
}))
.pipe(gulp.dest("./dist"));
var myCodeMirror = CodeMirror(document.body, {
value: "function myScript(){return 100;}\n",
mode: "javascript"
});