Skip to content

react example? #1

Open
Open

Description

@konsumer

I can't seem to find any react examples, especially next9 would be helpful, for easy SSR. Are there any?

Activity

  1. ryanblock commented on Nov 19, 2019

    @ryanblock
    Member

    Hey David, we did this for Begin (which hosts Architect apps), perhaps this will be of some use? https://github.com/begin-examples/node-create-react-app

    We haven't done anything with next yet, but we're looking at it!

  2. konsumer commented on Nov 19, 2019

    @konsumer
    ContributorAuthor

    That looks like it might get me closer. No SSR, but looks like it would work for client-side react.

    I recommend using npm-run-all for the start script, so you can run both front & back in parallell & Ctrl-C to stop them both at once.

    parcel does similar thing (no-config react app), and you can also use parcel-plugin-prerender to do static SSR (it pre-renders the pages as static HTML, then client rehydrates react app.) it requires you to work out all the static-routes you want it to hit, though. next has some improvements with dynamic routes and other little things. still not quite sure how to put it together and have routing working right with arc, though.

    I tried my hand at writing a proxy-plugin to turn files in public into pages, to get a round the step of pre-building static HTML, but it seemed pretty hacky and fragile, and would not work for dynamic-routes. I also saw the JSX proxy plugin that translates JSX source into regular JS, so it would require me to write my app totally differently, and I would lose a lot of features, and still not SSR.

    I'll keep thinking about it. thanks for the link @ryanblock

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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