fedosejev / react-essentials

Supporting React.js Essentials book readers.
http://reactessentials.com
219 stars 90 forks source link

Chapter 3: Does server-side rendering handle onclick events #73

Open lakshmantgld opened 8 years ago

lakshmantgld commented 8 years ago

React does server-side rendering of staic markup. The static markup may also contain some onclick events. In that case, how does it handle the onclick events.

My thinking: 1) Use the same component js file including handlers for onclick event. * First serve the static markup using rendertostring() in server. * Browserify the same file and add in the browserified js file in script tag of that html page.

By this, we both have server-side rendering and also handle events. Is this approach the right one.

lakshmantgld commented 8 years ago

Is it advisable to both server-side render and use the same file as browserified in the script tag of Html file