platformOS Community

Can we effectively use Next.js (React) on pOS?

Adam Cook Jun 03 2021 at 16:40

I'd love to try using Next.js, but after watching an hour-long tutorial on it, I'm not sure how well it would work with pOS. Can someone enlighten me? Routing looks like a direct conflict with how things are done on pOS.

Andrew@probity Jun 07 2021 at 01:59

You can use regular react on pOS, either for single page apps (using react router) or for just embedded widgets. But I don't think you would be able to get Next.js working and if you did I you would still miss out of the big features like server side react rendering and static page generation.

  • Adam Cook Jun 09 2021 at 03:08
    Thank you, Andrew! That's exactly what I needed to know.
Pawel Jun 23 2021 at 09:33

Some time ago I experimented with couple Static Site Generators successfully (Gatsby, Hugo, e11ty, Jekyll, Sapper) and my conclusion was this: As long as its output is static html (or sometimes, static files with liquid directives and .liquid extension) and it/you (by configuration, or using script) can put assets into proper place (app/assets) it should be compatible.
platformOS does not check/validate how the files got there thus not limiting what it will run.

I didnt inspect what Next is, but if it is another SSG it should just work.

Please sign in or fill up your profile to answer a question