@tanstack/react-table 8.0.0-alpha.6 → 8.0.0-alpha.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/build/cjs/createTable.js +15 -1
- package/build/cjs/createTable.js.map +1 -1
- package/build/esm/index.js +15 -1
- package/build/esm/index.js.map +1 -1
- package/build/stats-html.html +1 -1
- package/build/stats-react.json +229 -229
- package/build/umd/index.development.js +15 -1
- package/build/umd/index.development.js.map +1 -1
- package/build/umd/index.production.js +1 -1
- package/build/umd/index.production.js.map +1 -1
- package/package.json +1 -1
- package/src/createTable.tsx +25 -2
|
@@ -4767,9 +4767,23 @@
|
|
|
4767
4767
|
},
|
|
4768
4768
|
useTable: function useTable(options) {
|
|
4769
4769
|
var instanceRef = React__namespace.useRef(undefined);
|
|
4770
|
-
var
|
|
4770
|
+
var unsafeRerender = React__namespace.useReducer(function () {
|
|
4771
4771
|
return {};
|
|
4772
4772
|
}, {})[1];
|
|
4773
|
+
var isMountedRef = React__namespace.useRef(false);
|
|
4774
|
+
var rerender = React__namespace.useCallback(function () {
|
|
4775
|
+
if (!isMountedRef.current) {
|
|
4776
|
+
return;
|
|
4777
|
+
}
|
|
4778
|
+
|
|
4779
|
+
unsafeRerender();
|
|
4780
|
+
}, []);
|
|
4781
|
+
React__namespace.useLayoutEffect(function () {
|
|
4782
|
+
isMountedRef.current = true;
|
|
4783
|
+
return function () {
|
|
4784
|
+
isMountedRef.current = false;
|
|
4785
|
+
};
|
|
4786
|
+
});
|
|
4773
4787
|
|
|
4774
4788
|
if (!instanceRef.current) {
|
|
4775
4789
|
instanceRef.current = createTableInstance(options, rerender);
|