I need to open a Bootstrap Modal from clicking on a button in a Bootstrap navbar and other places (to show data for a component instance, ie. providing \"editing\" f
You can try this modal:https://github.com/xue2han/react-dynamic-modal It is stateless and can be rendered only when needed.So it is very easy to use.Just like this:
class MyModal extends Component{
render(){
const { text } = this.props;
return (
What you input : {text}
);
}
}
class App extends Component{
openModal(){
const text = this.refs.input.value;
ModalManager.open( true}/>);
}
render(){
return (
);
}
}
ReactDOM.render( ,document.getElementById('main'));