#2315 : Use of React.createFactory in example basic/

This commit is contained in:
ThomasCrvsr 2014-10-15 09:20:25 +02:00
parent 4f1f8c0605
commit e3734e2b43
1 changed files with 5 additions and 4 deletions

View File

@ -38,13 +38,14 @@
return React.DOM.p(null, message);
}
});
// Call React.createFactory instead of directly call ExampleApplication({...}) in React.renderComponent
var ExampleApplicationFactory = React.createFactory(ExampleApplication);
var start = new Date().getTime();
setInterval(function() {
React.renderComponent(
/* Call React.createElement instead of
* ExampleApplication({...}) which is depecrated
*/
React.createElement(ExampleApplication, {elapsed: new Date().getTime() - start}),
ExampleApplicationFactory({elapsed: new Date().getTime() - start}),
document.getElementById('container')
);
}, 50);