import React,{createContext} from 'react';
import ReactDOM from 'react-dom';
let {Provider, Consumer} = createContext();
//统一状态管理
class ProviderComponent extends React.Component{
render(){
return (
{this.props.children}
)
}
}
class Child extends React.Component{
render(){
return (
{(data)=>
{JSON.stringify(data)}
}
)
}
}
class App extends React.Component{
render(){
return (
)
}
}
ReactDOM.render(
, document.getElementById('root'));