-
Notifications
You must be signed in to change notification settings - Fork 0
/
demo.jsx
45 lines (33 loc) · 909 Bytes
/
demo.jsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
import 'babel-polyfill';
import React from 'react';
import ReactDOM from 'react-dom';
import DemoView from './components/views/DemoView.jsx';
//
// react-formstate
//
// Using the optional validation library for react-formstate's fluent api
import { FormState } from 'react-formstate';
// suppress deprecated props
FormState.rfsProps.updateFormState.suppress = true;
FormState.rfsProps.showValidationMessage.suppress = true;
import { validationAdapter } from 'react-formstate-validation';
validationAdapter.plugInto(FormState);
//
// redux
//
import { createStore, combineReducers } from 'redux';
import { forms } from './redux/reducers.es6';
const store = createStore(
combineReducers({ forms }),
{}
);
const renderApp = () => {
ReactDOM.render(
<DemoView store={store}/>,
document.getElementById('react-mount-point')
);
};
store.subscribe(() => {
renderApp();
});
renderApp();