Client Side AJAX Request on React-Snap

493 Views Asked by At

I am using react-snap package with my React Application which can generate basically a static form of my whole application. But it actually crawls all the AJAX data and fetches them then build the static site. But I want react-snap to skip some of the AJAX requests. I want my application to make those request whenever the client opens the static page.

1

There are 1 best solutions below

0
On BEST ANSWER

You can detect prerendering phase, like this if (navigator.userAgent === "ReactSnap") { ... }, and skip AJAX requests in your application.