Open srghma opened 1 month ago
Sorrry, I don't understand the question. What is next.js
?
framework that adds SSR to react https://github.com/vercel/next.js/
usually one writes
function MyPage() {
const data = requestDataFromServerHook()
return <div>....</div>
}
but with this framework can write
function MyPage(dataFetchedFromApiOnServerSite) {
return <div>....</div>
}
MyPage.specialFunctionToFetchOnServerSide = ...
can try to make such framework if there is a HTML -> Text printer
There is an HTML to String rendering function, but I suggest you have a look at idris2-dom-mvc, which comes without the FRP complexity of idris2-rhone-js.
how to accomplish what next.js accomplishes?
if website is requested first time - THEN send html with prerendered content ELSE (if just going to other page using browser) THEN request server /api for more data and render new page on browser side