reactjs - Getting a bootstrap element to render on plunker -
i'm brand new react , react-bootstrap figured start out rendering bootstrap component on plunker.
this has proven harder imagined , not sure doing wrong.
here plunk: http://plnkr.co/edit/mvbvht1fdliydpztr7pj?p=preview
<!doctype html> <html> <head> <script src="https://cdnjs.cloudflare.com/ajax/libs/react/0.14.1/react.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/react/0.14.1/react-dom.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/react-bootstrap/0.27.3/react-bootstrap.js"></script> <link rel="stylesheet" href="style.css" /> <script> var alert = reactbootstrap.alert; </script> </head> <body> <div id="example"></div> <script src="script.js"></script> </body> </html>
in jsx file on plunk:
var buttontoolbar = reactbootstrap.buttontoolbar; var button = reactbootstrap.button; var buttonsinstance = ( <div> <buttontoolbar> <button bsstyle="primary" bssize="large">large button</button> <button bssize="large">large button</button> </buttontoolbar> <buttontoolbar> <button bsstyle="primary">default button</button> <button>default button</button> </buttontoolbar> <buttontoolbar> <button bsstyle="primary" bssize="small">small button</button> <button bssize="small">small button</button> </buttontoolbar> <buttontoolbar> <button bsstyle="primary" bssize="xsmall">extra small button</button> <button bssize="xsmall">extra small button</button> </buttontoolbar> </div> ); react.render(buttonsinstance, document.getelementbyid('example');
i pasted in examples , made changes based on github threads try working not having joy.
what doing wrong?
you're missing closed parenthesis. change this:
react.render(buttonsinstance, document.getelementbyid('example');
into this:
react.render(buttonsinstance, document.getelementbyid('example'));
also, if want buttons rendered should remove call react.render
coming plunk example code:
/* react.render( <h1>rendered script.jsx!</h1>, document.getelementbyid('example') ); */
Comments
Post a Comment