reacted-express
React rendering server-side using Express
Install
npm install -s reacted-express
Usage
// Your React component you want to render server-side// components/app.jsx; Component { return <h1>Hello thispropsperson </h1> ; } // In your express file // Use reacted express as a middleware in your express file ; // ... app = ; // Renders App component as a HTML view app; // Voila! // ...
Inject a React component into a HTML source
Sometimes you want to inject your main component into a HTML source.
<!-- index.html -->Test React App<!-- This is the section you want to replace -->Loading<!-- Where the back-end props are copied -->
// ... app = ; // Will render the source of index.html// ... and replace 'Loading' by the HTML of MyComponent app; // ...
props
to client
Pass app; app;