How to use the createFactory function from react

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

-2
fork icon183
star icon987
watch icon49

136
137
138
139
140
141
142
143
144
145
      </div>
    );
  }
});

var MyFactory = React.createFactory(MyComponent);

var newComponent = MyFactory({
  model: {
    firstModel: new Backbone.Model({helloWorld: 'Hello world!'}),
fork icon73
star icon815
watch icon23

+ 3 other calls in file

78
79
80
81
82
83
84
85
86
87

// set assetspath to point to your image files
var assetpath = function(filename) { return '../assets/' + filename; };

var Sprite = React.createFactory(ReactPIXI.Sprite);
var DisplayObjectContainer = React.createFactory(ReactPIXI.DisplayObjectContainer);

var CupcakeComponent = React.createClass({
  displayName: 'CupcakeComponent',
  // maps from cupcake toppings to the appropriate sprite
fork icon73
star icon741
watch icon27

+ 3 other calls in file

7
8
9
10
11
12
13
14
15
16

## Usage

```javascript
var React = require('react');
var Ranger = React.createFactory(require('ranger'));

var files = Ranger.parseList([
    'code/test.txt',
    'code/makefile',
fork icon1
star icon22
watch icon4

0
1
2
3
4
5
6
7
8
9
// App

var React = require('react');
var data = require('./data');

var App = React.createFactory(require('./components/app.jsx'));

React.render(
  App(data),
  document.getElementById('app')
fork icon127
star icon12
watch icon11

6
7
8
9
10
11
12
13
14
15

let React = require('react');
let View = React.createFactory(require('react-native').View);
let Animated = require('react-native').Animated;
let AnimatedView = React.createFactory(Animated.View);
let Svg = React.createFactory(require('react-native-svg').Svg);
let Circle = React.createFactory(require('react-native-svg').Circle);
let Path = React.createFactory(require('react-native-svg').Path);
let G = React.createFactory(require('react-native-svg').G);
const beaufort = require('../lib/beaufort');
fork icon24
star icon178
watch icon6

+ 11 other calls in file

9
10
11
12
13
14
15
16
17
18
const csrf = require('csurf');
const React = require('react');
const ReactDOM = require('react-dom/server');
const app = require('./app');
const showTodos = require('./actions/showTodos');
const HtmlComponent = React.createFactory(require('./components/Html'));
const { createElementWithContext } = require('fluxible-addons-react');

const server = express();
server.set('state namespace', 'App');
fork icon232
star icon0
watch icon66

-2
fork icon84
star icon0
watch icon27

+ 3 other calls in file