-
Notifications
You must be signed in to change notification settings - Fork 755
Render static html client-side #442
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
You can use To get the // remove this:
//= require react for this line: // add this:
//= require react-server (this gives you the server bundle). I use this in my own app for integrating with other JS libraries that expect strings of HTML! Does that answer your question? |
(I'd like to improve that |
Is there any way to get a string of plain html from a react component, but on the client side?
My app has a design editor that lets you click elements and edit their style, nothing new there, but I'm re-making it from the ground up using react-rails both for the app itself and for the templates that should be edited inside an iframe and then rendered elsewhere.
Attaching click handlers to every editable element conditionally (eg: if the view is being rendered inside an iframe, for the editor) would be a nightmare, and I can't just use jquery $('.is-editable').click() like I used to because of the virtual DOM.
Taking all that in account, it seems that the only solution is rendering the would-be-edited view as plain HTML so I can use the $('.is-editable').click() approach inside my editor.
Any insights or similar experiences?
The text was updated successfully, but these errors were encountered: