React adapter ยท console.warn
<LatticeGrid onGridDestroy> is deprecated an...
Printed by React adapter, prefixed [lattice], since 1.127.0.
Warnings reference › react.onGridDestroy.deprecated
- Identifier
react.onGridDestroy.deprecated- Raised by
- React adapter
- Since
- 1.127.0
What happened
The React grid component was handed an onGridDestroy prop, the pre-1.127 name for the hook told just before the grid is destroyed. Every other wrapper spells this hook's second half in the past tense - Vue's @grid-destroyed, Svelte's onGridDestroyed - and React's own onGridReady already does, so onGridDestroy was the one inconsistent name. It still fires, alongside onGridDestroyed if both are bound.
The fix
Rename the prop to onGridDestroyed. Both fire during the deprecation window, so the rename is safe to do at any time.
The smallest fix
<LatticeGrid onGridDestroyed={() => cleanup()} />
Reference
Covered in full at the API reference.