Open jsw opened 3 years ago
@jsw I am afraid custom rendering, and as result all custom (third-party) widgets, will not work in Next JS.
Thank you, Andrew
@andrewtelnov Could you elaborate a bit on why it is not expected to work? I also tried NextJS dynamic import which is supposed to cause everything to render on the client. Any idea why this workaround also doesn't work? And any other aspects besides custom rendering/widgets that are not expected to work?
const DynamicSurvey = dynamic(import('./survey'), {
ssr: false
});
export default function Survey() {
return <DynamicSurvey/>;
}
Hi @andrewtelnov , I found a way to make it work thanks to this article you need to basically extract the survey component into its own file and then import it as a NoSSR component, works perfectly.
Are you requesting a feature, reporting a bug or asking a question?
Question
What is the current behavior?
Custom widget bootstrap-slider is not rendering. I'm not a surveyjs or NextJS expert, so hopefully it is something obvious to someone else that I am missing.
What is the expected behavior?
boostrap-slider renders.
How would you reproduce the current behavior (if this is a bug)?
Provide the test code and the tested page URL (if applicable)
Tested page URL:
Test code
pages/survey.tsx
_app.tsx
Specify your
Firefox 89.0.2 (mac) survey-react 1.8.47 surveyjs-widgets 1.8.56