11import React from 'react' ;
2+ import PropTypes from 'prop-types' ;
23import initHistory from './history' ;
34import { from } from 'most' ;
45import mostEngine from './engine/most' ;
@@ -8,9 +9,9 @@ export const HISTORY_STREAM = '@@reactive-react/react-most.historyStream';
89const MERGE_OBSERVE = '@@reactive-react/react-most.mergeObserve' ;
910
1011const CONTEXT_TYPE = {
11- [ INTENT_STREAM ] : React . PropTypes . object ,
12- [ HISTORY_STREAM ] : React . PropTypes . object ,
13- [ MERGE_OBSERVE ] : React . PropTypes . func ,
12+ [ INTENT_STREAM ] : PropTypes . object ,
13+ [ HISTORY_STREAM ] : PropTypes . object ,
14+ [ MERGE_OBSERVE ] : PropTypes . func ,
1415} ;
1516
1617function pick ( names , obj ) {
@@ -118,8 +119,7 @@ export function connect(main, opts = {}) {
118119 } ;
119120}
120121
121- let Most = React . createClass ( {
122- childContextTypes : CONTEXT_TYPE ,
122+ export default class Most extends React . PureComponent {
123123 getChildContext ( ) {
124124 let engineClass = ( this . props && this . props . engine ) || mostEngine ;
125125 let engine = engineClass ( ) ;
@@ -132,13 +132,12 @@ let Most = React.createClass({
132132 [ MERGE_OBSERVE ] : engine . mergeObserve ,
133133 [ HISTORY_STREAM ] : engine . historyStream ,
134134 } ;
135- } ,
135+ }
136136 render ( ) {
137137 return React . Children . only ( this . props . children ) ;
138- } ,
139- } ) ;
140-
141- export default Most ;
138+ }
139+ }
140+ Most . childContextTypes = CONTEXT_TYPE ;
142141
143142function observable ( obj ) {
144143 return ! ! obj . subscribe ;
0 commit comments