Skip to content

Render static html client-side #442

@alfredoreduarte

Description

@alfredoreduarte

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions