Using GridStack.js with React hooks

As with any virtualDOM-based framework, you need to check if Reacthas rendered the DOM (or any updates to it) before you initialize GridStack or call its methods. This example shows how to make rendered components widgets:

  1. Render items, each with a reference
  2. Convert each rendered item to a widget using the reference and the makeWidget function

Controlled stack

Uncontrolled stack