react-async

Render a component from outside ReactJS

心不动则不痛 提交于 2019-11-28 10:06:02
From here : "The only way to get a handle to a React Component instance outside of React is by storing the return value of React.render." I need to render a React component outside React and the reason for it I'm going to mention below. In my node.js, expressJS app, I am using 'react-router-component' and 'react-async' . In app.js -the file which is supposed to be run , var url=require('url'); var App=require('./react/App.jsx'); var app = express(); app.get('*',function(req,res){ //}); SEE EDIT 1 BELOW var path = url.parse(req.url).pathname; ReactAsync.renderComponentToStringWithAsyncState(App

Render a component from outside ReactJS

风格不统一 提交于 2019-11-27 03:25:35
问题 From here : "The only way to get a handle to a React Component instance outside of React is by storing the return value of React.render." I need to render a React component outside React and the reason for it I'm going to mention below. In my node.js, expressJS app, I am using 'react-router-component' and 'react-async'. In app.js -the file which is supposed to be run , var url=require('url'); var App=require('./react/App.jsx'); var app = express(); app.get('*',function(req,res){ //}); SEE