0

Can anyone give me idea on implementing react-simple-jstree with nextjs?

When I try to implement the same with reactjs it returns an error saying

jQuery requires a window with a document

James Z
  • 12,209
  • 10
  • 24
  • 44
nish
  • 3
  • 2
  • Does this answer your question? [Window is not defined in NextJS React app?](https://stackoverflow.com/questions/55151041/window-is-not-defined-in-nextjs-react-app) – Agney Apr 03 '20 at 16:40
  • I want my tree structure with jstree contextmenu structure using reactjs/nextjs.Screenshot as below: – nish Apr 04 '20 at 06:26

1 Answers1

0

NextJS is server-side rendering, window is only available only in browser, so u need to disable SSR to load react-simple-jstree

const ReactJson = dynamic(() => import('react-simple-jstree'), { ssr: false });
Vengleab SO
  • 716
  • 4
  • 11