Handling events/onClick #2
Comments
This project is only for generating markup on the server side and doesn't support attaching events on the client-side or doing client-side updates afterwards. If you need that you'll need to call React.renderComponentToString yourself and then call React.renderComponent with the same props. Here's an example of how to do so: https://github.com/facebook/react/tree/master/examples/server-rendering You can also use something like react-quickstart as a template. |
Oh okay… it is pretty cumbersome this way :-( I end up with a 500K browserified file just with 4 components. |
Really? React itself is only 112k when minified (and 121k including addons). If you're seeing 500k you might be doing something wrong. |
Well I am running Nothing much fancy. |
Does it help if you try --external React and not require js? Ustun On May 7, 2014, at 5:01 PM, Thomas Parisot notifications@github.com wrote:
|
@ustun a bit late but I solved that by using the "browser": {
"react": "./node_modules/react/dist/react.min.js"
}, Code goes from 1.6MB to 300K. |
Good to know, I have since switched to webpack though, it seems better overall. The equivalent there is the following for anyone interested:
|
Hey @sophiebits , could you please re-add the link, or post a snippet as the link you´ve pasted here is no longer active? |
Hello,
I have the following JSX component:
The thing is the
onClick
is removed from the view and I do not see where I could grab the possibly generated autobinding/delegation JS code.Maybe I am missing something. Maybe I am missing how I should implement the same reactified view on the client side.
The text was updated successfully, but these errors were encountered: