I am using node.js with react.js as my templating library. I am able to render my components on server side by using node's res.render(..), but I want to make my components dynamic by rendering them on client side using react.js and calling the onclick handlers. I have my components defined in .jsx format. How can I interact with the browser in client side and render my react components dynamically?
-
I am doing this. Instead of using react as just a templating library (like the Hapi react plugin) I went down the route of creating a proper Universal React configuration. It's quite complicated to set up initially but it's amazing when you get going. Check out this example: github.com/choonkending/react-webpack-nodectrlplusb– ctrlplusb2016-04-18 13:29:33 +00:00Commented Apr 18, 2016 at 13:29
Add a comment
|
2 Answers
You can start using it with ES6 class syntax using babel js. I have created a sample component here
You can also use react-starter-kit which gives you all the setup pre-loaded. A good place to start would be Facebook's react documentation