Skip to content

Instantly share code, notes, and snippets.

@monkindey
Created October 11, 2017 12:33
Show Gist options
  • Save monkindey/f556ca991e98b88456f8e39a9e7943b9 to your computer and use it in GitHub Desktop.
Save monkindey/f556ca991e98b88456f8e39a9e7943b9 to your computer and use it in GitHub Desktop.
class Slider extends Component{
renderPlugins(){
let { children } = this.props;
let dataModel = {...this.props,...this.state};
return do{
if(typeof children=='function'){;
children(dataModel)
}else{
children;
}
}
}
render(){
return <div>
hello world
{this.props.children && this.renderPlugins() }
</div>
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment