Closed kamal-choudhary closed 2 years ago
SurveyJS is a client-side JavaScript library. At this moment it doesn't support server-side rendering.
Thank you for the quick response.
So, it means that we can't use it with NextJS? Or is there any workaround to make it work with NextJS?
I'm not an expert in NextJS. Probably you can disable SSR and this will work for you.
okay, I got it. Thank you very much for your time!!!
Posting this solution for future readers.
This is how I am using this library in the NextJS.
pages/survey-view.js
import React from 'react';
import dynamic from 'next/dynamic';
import PageLoader from './PageLoader'; // Loading Spinner
const Survey = dynamic(() => import('./SurveyView'), {
loading: () => <PageLoader />,
ssr: false,
});
export default function SurveyPage() {
return <Survey />;
}
Hi, thank you for the awesome quickstart application.
I am trying to convert this quickstart application from React to NextJS.
But, I have been failing again and again.
Now, I am wondering that whether it is possible that it can work with NextJS or not?
Because this SurveyJS library is a browser-side library. While NextJS is often used for severe side rendering or static generation.
I'll be very thankful to you for your help.