score:19

Accepted answer

you cn just add to list of dependencies of useeffect hook not an array itself, but just length property like this

useeffect(() => {
      // this code only fires on length change
}, [columns.length]);

and sample


Related Query

More Query from same tag