first commit

This commit is contained in:
Stefan Hacker
2026-04-03 09:38:48 +02:00
commit 37ad745546
47450 changed files with 3120798 additions and 0 deletions
+14
View File
@@ -0,0 +1,14 @@
define(["require", "exports", "react", "./useConst"], function (require, exports, React, useConst_1) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.useForceUpdate = useForceUpdate;
/**
* Hook to force update a function component by updating a dummy state.
*/
function useForceUpdate() {
var _a = React.useState(0), setValue = _a[1];
var forceUpdate = (0, useConst_1.useConst)(function () { return function () { return setValue(function (value) { return ++value; }); }; });
return forceUpdate;
}
});
//# sourceMappingURL=useForceUpdate.js.map