diff --git a/demo/index.html b/demo/index.html index a47b5fa53..e30649bd0 100644 --- a/demo/index.html +++ b/demo/index.html @@ -15,6 +15,7 @@

Demos

  • Nested grids
  • Responsive
  • ReactJS
  • +
  • ReactJS (Hooks)
  • Right-To-Left (RTL)
  • Serialization
  • Static
  • diff --git a/demo/react-hooks.html b/demo/react-hooks.html new file mode 100644 index 000000000..e3c8e6fd9 --- /dev/null +++ b/demo/react-hooks.html @@ -0,0 +1,189 @@ + + + + + + + Gridstack.js React integration example + + + + + + + + + + +
    +

    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. +
    3. Convert each rendered item to a widget using the reference and the + makeWidget function
    4. +
    +
    +
    +

    Controlled stack

    +
    +
    +
    +

    Uncontrolled stack

    +
    +
    + + + + + \ No newline at end of file diff --git a/doc/CHANGES.md b/doc/CHANGES.md index d7533b8db..831d950ed 100644 --- a/doc/CHANGES.md +++ b/doc/CHANGES.md @@ -5,7 +5,7 @@ Change log **Table of Contents** *generated with [DocToc](http://doctoc.herokuapp.com/)* -- [3.1.2 (2020-12-7)](#311-2020-12-7) +- [3.1.2 (2020-12-7)](#312-2020-12-7) - [3.1.0 (2020-12-4)](#310-2020-12-4) - [3.0.0 (2020-11-29)](#300-2020-11-29) - [2.2.0 (2020-11-7)](#220-2020-11-7)