Skip to content

Server Side rendering example? #4

Open
@tconroy

Description

@tconroy

This medium post and this repo are the cleanest examples of code splitting I've found, so thank you!

One thing I'd like to request is an example of a server side implementation, where the initial state is set by the server and returned to the client with the appropriate bundles.

Activity

grgur

grgur commented on Nov 14, 2016

@grgur
Member

Thanks @tconroy. I fully agree. Let's see if we can have someone help out

jfresco

jfresco commented on Oct 18, 2017

@jfresco

@tconroy I could make SSR work by changing a little bit the getComponent functions. It works in my setup, I didn't try it in this project.

getComponent(location, cb) {
  if (process.env.IS_BROWSER) {
    System.import('pages/Home').then(loadRoute(cb)).catch(errorLoading);
  } else {
    cb(null, require('pages/Home').default))
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @grgur@tconroy@jfresco

        Issue actions

          Server Side rendering example? · Issue #4 · ModusCreateOrg/react-dynamic-route-loading-es6