Skip to content

How server-side rendering works #57

@volkanunsal

Description

@volkanunsal

I feel like this passage needs to be unpacked a little for lay users like me.

React components can also use the same ExecJS mechanisims in Sprockets to execute JavaScript code on the server, and render React components to HTML to be delivered to the browser, and then the react_ujs script will cause the component to be mounted. In this way, users get fast initial page loads and search-engine-friendly pages.

I have questions about this. Say I have a page like this:

#page=react_component("Page", {}, prerender: true)

When I tested this just now, the page is being rendered on the client, even when I go to it directly. That makes me think there is an additional step I am missing that should be explained in the README. When exactly is the HTML rendered on the server?

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