1var s = "xs"; 2React.createClass({ 3 render() { 4 return ( 5 <ul class="cscdd" data-toto={ return 1 + "cdxs" }> cqsd 6 { 7 if (true) { 8 <BreadcrumbItem href="#/messages/{ this.props.scope.get('scopes') || this.props.scope.get('parent') }"> 9 hello 10 </BreadcrumbItem> 11 } 12 } 13 </ul> 14 ); 15 } 16}); 17 18render() { 19 return ( 20 <> 21 Some text. 22 <h2>A heading</h2> 23 More text. 24 <h2>Another heading</h2> 25 Even more text. 26 </> 27 ); 28} 29 30return ( 31 <ModalTrigger modal={<InviteForm auth={this.props.auth} />} /> 32); 33 34return ( 35 <li> 36 <ModalTrigger modal={ <InviteForm auth={this.props.auth} /> }> 37 <a href="#">Invite Representative</a> 38 </ModalTrigger> 39 </li> 40); 41 42return ( 43 <div> 44 <div>xs</div> 45 <OtherComponent/> 46 <OtherComponent class="toto" 47 {...props} 48 id="fr" /> 49 </div>; 50); 51 52const Demo = () => ( 53 <ListItem 54 leftAvatar={ 55 <Avatar 56 src="" 57 /> 58 } 59 > 60 </ListItem> 61); 62 63import React, {Component} from 'react'; 64class Confirm extends Component { 65 render() { 66 const project = this.props.project; 67 return ( 68 <Route exac path='/' render={(matchProps) => ( 69 <DefaultLayout> 70 <Home {...matchProps} /> 71 </DefaultLayout> 72 )} /> 73 ) 74 }, 75 render() { 76 const project = this.props.project; 77 return ( 78 <Foo 79 someLongValue='x' 80 text={ 81 <Text> 82 text 83 </Text> 84 } 85 /> 86 ) 87 } 88} 89 90import React, {Component} from 'react'; 91class Confirm extends Component { 92 render() { 93 const project = this.props.project; 94 return ( 95 <Route 96 exact 97 path="/" 98 render={ matchProps => ( 99 <Home {...matchProps} />) 100 } 101 /> 102 ) 103 } 104}; 105 106class Test extends Component { 107 render() { 108 return ( 109 <Router> 110 <Switch> 111 <Route 112 exact 113 path="/" 114 render={matchProps => ( 115 <DefaultLayout> 116 <Home {...matchProps} /> 117 </DefaultLayout> 118 )} /> 119 <Route 120 path="/settings" 121 render={matchProps => ( 122 <DefaultLayout> 123 <Settings {...matchProps} /> 124 </DefaultLayout> 125 )} /> 126 </Switch> 127 </Router> 128 ) 129 } 130}; 131 132import React from 'react'; 133 134const Front = props => { 135 return <div> 136 <span>hello</span> 137 </div>; 138}; 139 140/** @jsx React.DOM **/ 141var React = require('react/addons'); 142var Component = require('./component'); 143 144function f() { 145 return true 146 && <E b={true} /> 147 || <E />; 148} 149 150export default class Header extends Component { 151 render() { 152 return ( 153 <div {...attributes} 154 onClick={this.onClicked} 155 onKeyDown={this.onKeyDowned}> 156 {this.getChildren()} 157 </div>); 158 } 159} 160 161import * as React from 'react'; 162 163interface Props { 164 name: string 165} 166 167class MyThing extends React.Component<Props, {}> { 168 render() { 169 return <span>hi</span>; 170 } 171} 172 173export default MyThing as React.ComponentClass<Props>; 174 175export default React.createClass({ 176 getInitialState() { 177 return { num: this.getRandomNumber() }; 178 }, 179 180 getRandomNumber(): number { 181 return Math.ceil(Math.random() * 6); 182 }, 183 render(): any { 184 return 185 <div> 186 Your dice roll : 187 {this.state.num} 188 </div>; 189 } 190}); 191 192function foo() { 193 return <label> 194 First Name: 195 <Input name="name" 196 type="text" 197 validators={[ 198 required('You must supply a first name!'), 199 (value) => value > 15 ? 'too long!': null 200 ]} /> 201 </label>; 202} 203 204import React, {Component} from 'react'; 205class Confirm extends Component { 206 render() { 207 const project = this.props.project; 208 return ( 209 <Switch> 210 <Route 211 path={'/home'} 212 render={ (props) => ( 213 <Home {...props} /> 214 )} /> 215 </Switch> 216 ) 217 } 218} 219 220// #870 221import React, {Component} from 'react'; 222class Confirm extends Component { 223 render() { 224 const project = this.props.project; 225 return ( 226 <form onSubmit=""> 227 <fieldset> 228 {project.foo && ( 229 <div>Foo</div> 230 )} 231 {project.bar && ( 232 <p>Bar</p> 233 )} 234 </fieldset> 235 </form> 236 ); 237 } 238} 239export default Confirm; 240 241 242var React = require('react') 243 244return React.render( 245 <div className="fooBar"> 246 { 247 conditional && 248 <myComponent className="myComponent" /> 249 } 250 <label>{labelText}</label> 251 <div> 252 <span>Hello</span> 253 </div> 254 </div> 255); 256 257'use strict'; 258 259var React = require('react'), 260 Explore = require('./components/Explore'), 261 DocumentTitle = require('react-document-title'), 262 { RouteHandler } = require('react-router'), 263 { PropTypes } = React; 264 265var App = React.createClass({ 266 propTypes: { 267 params: PropTypes.object.isRequired, 268 query: PropTypes.object.isRequired 269 }, 270 271 render() { 272 return ( 273 <DocumentTitle title='Sample App'> 274 <div className='App'> 275 <Explore /> 276 <hr /> 277 <RouteHandler {...this.props} /> 278 </div> 279 </DocumentTitle> 280 ); 281 } 282}); 283 284module.exports = App; 285 286module.exports = React.createClass({ 287 render() { 288 return ( 289 <div> 290 <Component header={<ListHeader />} footer={<ListFooter />} 291 attr="cqs" xs="xs" 292 xsxs="sxx" /> 293 <Component /> 294 <Component /> 295 </div> 296 ); 297 } 298}); 299 300module.exports = React.createClass({ 301 render() { 302 return ( 303 <tag> 304 bla { <inside> { <ListHeader /> } </inside> } bla 305 </tag> 306 ); 307 } 308}); 309 310module.exports = React.createClass({ 311 render() { 312 return ( 313 <ul> 314 { 315 this.props.list.map(function(element) { 316 return <li>{element}</li>; 317 }) 318 } 319 </ul> 320 ); 321 } 322}); 323 324 325Landing = React.createClass({ 326 render: function() { 327 return ( 328 <ul> 329 { for(e in list){ 330 console.log("not aligned"); 331 }} 332 </ul> 333 ); 334 } 335}); 336 337var Component = React.createClass({ 338 render : function() { 339 var stuff = this.props.formElements.map(function(elem) { 340 switch(elem) { 341 case "textarea" : 342 return ( <textarea rows="4" /> ); 343 break; 344 case "text" : 345 return ( <input type="text" /> ); 346 default : 347 return null; 348 } 349 }); 350 } 351}); 352 353define(function (require) { 354 'use strict'; 355 356 var React = require('react'); 357 var ModalTrigger = require('react-bootstrap').ModalTrigger; 358 var InviteForm = require('components/InviteForm'); 359 360 var InviteLink = React.createClass({ 361 render: function() { 362 if (this.props.auth.loggedIn()) { 363 return ( 364 <li> 365 <ModalTrigger modal={<InviteForm auth={this.props.auth} />}> 366 <a href="#">Invite Representative</a> 367 </ModalTrigger> 368 </li> 369 ); 370 } else { 371 return <span></span>; 372 } 373 } 374 }); 375 376 return InviteLink; 377}); 378 379function hello() { 380 381 return ( 382 <div> 383 {somevar} 384 <div className="row"> 385 <div className="col-md-4"> 386 Column1 387 </div> 388 <div className="col-md-4"> 389 Column2 390 </div> 391 </div> 392 </div> 393 ); 394 395} 396 397React.createClass({ 398 render() { 399 return ( 400 <ul class="cscdd" data-toto={ return 1 + "cdxs" }> cqsd 401 { (this.props.scope.get('type') !== "home") ? 402 <BreadcrumbItem href="#/messages/{this.props.scope.get('scope') || this.props.scope.get('parent')}"> 403 {this.props.scope.get('scope') || this.props.scope.get('parent')} 404 </BreadcrumbItem> : null} 405 </ul> 406 ); 407 } 408}); 409 410 411React.createClass({ 412 render() { 413 return ( 414 <ul class="cscdd" data-toto={ return 1 + "cdxs" }> cqsd 415 { this.props.list.map(function(element) { 416 var x = 1; 417 return <li class="dxs" x="xs">{ "aa" + this.getModel().get('bb') }</li> 418 }) } cqsdc { return "cd"; } 419 </ul> 420 ) 421 } 422}); 423 424return ( 425 <li> 426 <ModalTrigger test="xs" test="dccd" modal={ <InviteForm> }> 427 <a href="#">Invite Representative</a> 428 </ModalTrigger> 429 </li> 430); 431 432 433return ( 434 <li> 435 <ModalTrigger modal={ <InviteForm auth={this.props.auth} /> }> 436 <a href="#">Invite Representative</a> 437 </ModalTrigger> 438 </li> 439); 440 441var MyClass = react.createClass({ 442 render: function() { 443 return 444 <div> 445 <OtherComponent/> 446 <OtherComponent class="toto" 447 {...props} 448 id="fr" /> 449 </div>; 450 } 451}); 452