How can next.js render components into json format?

Viewed 66

We're migrating from a server side rendered approach with Java to a hybrid approach with React. For this we build endpoints into a express server, which render our React components with ReactDOMServer.renderToNodeStream and deliver the output to another service which includes the components into it's DOM.

When looking forward it would be nice to use technologies like next.js.

Is there a way to output rendered components/pages by next.js in a JSON format? Or is it restricted to html? This would be every helpful specially in scenarios where you can't migrate a page in one shot.

0 Answers
Related