Socket
Socket
Sign inDemoInstall

@tamagui/use-force-update

Package Overview
Dependencies
Maintainers
1
Versions
1151
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tamagui/use-force-update - npm Package Compare versions

Comparing version 1.0.0-beta.202 to 1.0.0-beta.203

24

dist/cjs/index.js

@@ -26,22 +26,10 @@ var __defProp = Object.defineProperty;

function useForceUpdate() {
const setState = (0, import_react.useState)(0)[1];
const internal = (0, import_react.useRef)();
if (!internal.current) {
internal.current = {
isMounted: true,
update: () => {
if (internal.current.isMounted) {
setState(Math.random());
}
}
};
}
(0, import_react.useEffect)(() => {
return () => {
internal.current.isMounted = false;
};
}, []);
return internal.current.update;
const [_, forceUpdate] = (0, import_react.useReducer)((x) => x + 1, 0);
return forceUpdate;
}
__name(useForceUpdate, "useForceUpdate");
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
useForceUpdate
});
//# sourceMappingURL=index.js.map
var __defProp = Object.defineProperty;
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
import { useEffect, useRef, useState } from "react";
import { useReducer } from "react";
function useForceUpdate() {
const setState = useState(0)[1];
const internal = useRef();
if (!internal.current) {
internal.current = {
isMounted: true,
update: () => {
if (internal.current.isMounted) {
setState(Math.random());
}
}
};
}
useEffect(() => {
return () => {
internal.current.isMounted = false;
};
}, []);
return internal.current.update;
const [_, forceUpdate] = useReducer((x) => x + 1, 0);
return forceUpdate;
}

@@ -24,0 +8,0 @@ __name(useForceUpdate, "useForceUpdate");

var __defProp = Object.defineProperty;
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
import { useEffect, useRef, useState } from "react";
import { useReducer } from "react";
function useForceUpdate() {
const setState = useState(0)[1];
const internal = useRef();
if (!internal.current) {
internal.current = {
isMounted: true,
update: () => {
if (internal.current.isMounted) {
setState(Math.random());
}
}
};
}
useEffect(() => {
return () => {
internal.current.isMounted = false;
};
}, []);
return internal.current.update;
const [_, forceUpdate] = useReducer((x) => x + 1, 0);
return forceUpdate;
}

@@ -24,0 +8,0 @@ __name(useForceUpdate, "useForceUpdate");

{
"name": "@tamagui/use-force-update",
"version": "1.0.0-beta.202+a1a54793",
"version": "1.0.0-beta.203+bdbb1f11",
"typings": "types",

@@ -19,5 +19,6 @@ "main": "dist/cjs",

"devDependencies": {
"@tamagui/build": "^1.0.0-beta.202+a1a54793"
"@tamagui/build": "^1.0.0-beta.203+bdbb1f11",
"react": "*"
},
"dependencies": {
"peerDependencies": {
"react": "*"

@@ -28,3 +29,3 @@ },

},
"gitHead": "a1a54793ee1890507fc934f42f2eb3a4020b57c5"
"gitHead": "bdbb1f11fae44e3a78133373ef108adccaa68924"
}

@@ -1,2 +0,3 @@

export declare function useForceUpdate(): Function;
/// <reference types="react" />
export declare function useForceUpdate(): import("react").DispatchWithoutAction;
//# sourceMappingURL=index.d.ts.map

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc