1 <!DOCTYPE HTML>2 <HTML>3 <Head>4 <MetaCharSet= "UTF-8" />5 <title></title>6 <Scriptsrc= "React/react-0.14.7/build/react.js"></Script>7 <Scriptsrc= "React/react-0.14.7/build/react-dom.js"></Script>8 <Scriptsrc= "React/browser.min.js"></Script>9 <Scripttype= "Text/ecmascript"src= "App/scripts/vendor/jquery.min.js"></Script>Ten <Scriptsrc= "App/scripts/vendor/underscore.js"></Script> One <Scriptsrc= "App/scripts/vendor/backbone.js"></Script> A </Head> - <Body> - <DivID= "Example"></Div> the <Scripttype= "Text/babel"> - varHelloMessage=React.createclass ({ - Render:function() { - return <H1>Hello world! { This. Props.name}</h1>; + } - }); + A Reactdom.render ( at <HelloMessage/, - document.getElementById ('Example') - ); - - - varMyView=Backbone.View.extend ({ in el:'Body', - Template:'<div class= "Widget-container" ></div>', to Render:function() { + This. $el. HTML ( This. template); - varHM=react.createfactory (HelloMessage); the Reactdom.render (NewHM ({name:'xxxxx'}), This.$('. Widget-container'). Get (0)); * //Reactdom.render (HM ({name: ' xxxxx '}), this.$ ('. Widget-container '). Get (0)); $ //Reactdom.render (Panax Notoginseng //Reactdom.render ( - return This; the } + }); A the NewMyView (). render (); + </Script> - </Body> $ </HTML>
Backbone View rendering react components