spatie / server-side-rendering

Server side rendering JavaScript in a PHP application
https://sebastiandedeyne.com/posts/2018/server-side-rendering-javascript-from-php
MIT License
602 stars 34 forks source link

react with nextjs for async api calls #25

Closed AidasK closed 4 years ago

AidasK commented 5 years ago

Has anybody used next.js to render react application to string? Current approach does not work for me, because react renderToString method ignores all "fetch" requests to external apis and nextjs handles it properly. Though nextjs only works with expressjs and it does not have proper documentation for advanced usage.

calvinchankf commented 5 years ago

i have the same problem, did u find a wayout eventually?

AidasK commented 5 years ago

It won't work. You need to use next.js and laravel for api only. I tried to find an easier way, but there isn't one. I wonder why react called it SSR if it only doing pre-rendering...

spatie-bot commented 4 years ago

Dear contributor,

because this issue seems to be inactive for quite some time now, I've automatically closed it. If you feel this issue deserves some attention from my human colleagues feel free to reopen it.