@adaptabletools/adaptable-react-aggrid 23.0.0-canary.5 → 23.0.0-canary.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adaptabletools/adaptable-react-aggrid",
3
- "version": "23.0.0-canary.5",
3
+ "version": "23.0.0-canary.7",
4
4
  "description": "React version of AdapTable - the powerful data-agnostic HTML5 AG Grid extension which provides advanced, cutting-edge functionality to meet all DataGrid requirements",
5
5
  "keywords": [],
6
6
  "license": "contact sales@adaptabletools.com for details",
@@ -8,7 +8,7 @@
8
8
  "dependencies": {
9
9
  "tslib": "^2.8.1",
10
10
  "react-redux": "9.2.0",
11
- "@adaptabletools/adaptable": "23.0.0-canary.5"
11
+ "@adaptabletools/adaptable": "23.0.0-canary.7"
12
12
  },
13
13
  "peerDependencies": {
14
14
  "ag-grid-enterprise": ">=35.3.0",
@@ -25,6 +25,20 @@ const AdaptableReact = ({ adaptableOptions, gridOptions, onAdaptableReady, ...pr
25
25
  destroyAgGrid: false,
26
26
  });
27
27
  adaptableApiRef.current = null;
28
+ // We fully tore down a *ready* instance — i.e. a real unmount such as
29
+ // navigation or an HMR / Fast Refresh update (where the container is
30
+ // remounted but `id`, derived from `useId()`, stays the same). Clear the
31
+ // module-level guards so the instance is recreated when the container
32
+ // mounts again. Without this, `isInstanceStarted(id)` stays `true` and
33
+ // the destroyed instance is never replaced, leaving components holding a
34
+ // null api.
35
+ //
36
+ // In React StrictMode the transient unmount happens *before* the instance
37
+ // becomes ready, so `successInstances.get(id)` is not yet `true` and this
38
+ // branch is skipped — preserving the single in-flight init (no double
39
+ // initialization).
40
+ startedInstances.delete(id);
41
+ successInstances.delete(id);
28
42
  }
29
43
  }, [id]);
30
44
  const containerRef = useCallback((node) => {