react-teleport
A neat way of handling views on other components
Usage
Just mount a destination on one of your components:
var React = require('react'),
Destination = require('react-teleport').Destination;
module.exports = module.exports = React.createClass({
render: function () {
return (
<div>
<Destination name="header"/>
</div>
);
}
});
and then send an element from another:
var React = require('react'),
Portal = require('react-teleport').Portal;
module.exports = module.exports = React.createClass({
render: function () {
return (
<div>
<Portal destination="header">
<nav>
<a href="#">some</a>
<a href="#">breadcrumbs</a>
<a href="#">on the header!</a>
</nav>
</Portal>
</div>
);
}
});