Created
August 10, 2014 11:43
-
-
Save cassus/11fe389b71a808af2d84 to your computer and use it in GitHub Desktop.
Open a react-bootstrap.Modal from a react-router Route
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** @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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Could you, please, explain how to use that component?