I have built a react component which I would like to render from within a second component in a separate file.
StoryStrap.react.js
var React = require('react');
import { Input, ButtonInput, Alert } from 'react-bootstrap';
var StoryStrap = React.createClass({
render: function() {
return (
<div>
<Input type="text" placeholder="Headline" />
<Input type="text" placeholder="Subline" />
</div>
);
}
});
module.exports = StoryStrap;
How can I display this component from the return method of a second component in a different file?
MainSection.react.js
return (
<div className="container">
<div className="row row-grid">
<section id="ROTopBar" className="ro-topBar box-shadow--2dp">
<div id="storyStraps" className="col-md-4">
<h4>Story Straps</h4>
<StoryStrap /> //Display storyStrap component here
</div>
<div id="storyNames" className="col-md-4">
<h4>Name</h4>
</div>
<div id="storyInfo" className="col-md-4">
<h4>Info</h4>
</div>
</section>
</div>
</div>
);
requireandimportso you already have the ability to import it..?