Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

react.js rendering react components on client side

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?

like image 419
medha Avatar asked Sep 09 '26 16:09

medha


1 Answers

You will need to have your code transpiled and bundled, then you can insert it in a script tag just like any other script. One popular option is webpack; another is the use of Browserify with babelify in a gulp task.

like image 168
Ezra Chang Avatar answered Sep 12 '26 09:09

Ezra Chang