Skip to content

Instantly share code, notes, and snippets.

@cassus
Created August 10, 2014 11:43
Show Gist options
  • Save cassus/11fe389b71a808af2d84 to your computer and use it in GitHub Desktop.
Save cassus/11fe389b71a808af2d84 to your computer and use it in GitHub Desktop.
Open a react-bootstrap.Modal from a react-router Route
/** @jsx React.DOM */
/** @type React */
module React from 'react'
var RB = require('react-bootstrap')
module Router from 'react-router'
var DisplayModal = React.createClass({
mixins: [RB.OverlayMixin],
propTypes: {
modal: React.PropTypes.any.isRequired, // React modal component class
onRequestHide: React.PropTypes.func.isRequired,
},
render() {
return null
},
renderOverlay() {
return (
<this.props.modal onRequestHide={this.props.onRequestHide} />
);
}
})
module.exports = DisplayModal
@roman-kh
Copy link

Could you, please, explain how to use that component?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment