How to use the DOM function from react

Find comprehensive JavaScript react.DOM code examples handpicked from public code repositorys.

163
164
165
166
167
168
169
170
171
  helloWorld: 'Hello world!'
});
var HelloWorld = React.createClass({
  mixins: [backboneMixin],
  render: function () {
    return React.DOM.div({}, this.state.model.helloWorld);
  }
});
var HelloWorldFactory = React.createFactory(HelloWorld);
fork icon73
star icon815
watch icon23

34
35
36
37
38
39
40
41
42
우선, 밑의 `require`를 추가하세요.

```
var React = require('react');
var ReactDOMServer = require('react-dom/server');
var DOM = React.DOM;
var body = DOM.body;
var div = DOM.div;
var script = DOM.script;
fork icon146
star icon531
watch icon13

42
43
44
45
46
47
48
49
50
51

function makeIndex () {
  var list = fs.readdirSync(ENTRIES_DIR).filter(function(dir) {
    return isDirectory(path.join(ENTRIES_DIR, dir));
  }).map(function (dir) {
    return React.DOM.li({}, React.DOM.a({href: '/'+dir}, dir.replace(/-/g, ' ')));
  });
  var markup = React.renderToStaticMarkup((
    React.DOM.html({},
      React.DOM.link({rel: 'stylesheet', href: '/shared.css'}),
fork icon7
star icon101
watch icon7

+ 9 other calls in file

158
159
160
161
162
163
164
165
166
167
    var inputValue = input.value;
    var inputRect = input.getBoundingClientRect();
    // ...
  }
}, function (props) {
  return React.DOM.input({ value: props.cursor.get('text'), ref: 'myInput' });
});
```

#### Talking back from child to parent
fork icon55
star icon0
watch icon36

+ 7 other calls in file