@tamagui/use-previous 1.125.21 → 1.125.22
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 +2 -2
- package/types/index.d.ts.map +13 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tamagui/use-previous",
|
|
3
|
-
"version": "1.125.
|
|
3
|
+
"version": "1.125.22",
|
|
4
4
|
"types": "./types/index.d.ts",
|
|
5
5
|
"main": "dist/cjs",
|
|
6
6
|
"module": "dist/esm",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"clean:build": "tamagui-build clean:build"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
|
-
"@tamagui/build": "1.125.
|
|
21
|
+
"@tamagui/build": "1.125.22"
|
|
22
22
|
},
|
|
23
23
|
"exports": {
|
|
24
24
|
"./package.json": "./package.json",
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"mappings": "AAIA,OAAO,iBAAS,YAAY,GAAGA,OAAO,IAAI",
|
|
3
|
+
"names": [
|
|
4
|
+
"value: T"
|
|
5
|
+
],
|
|
6
|
+
"sources": [
|
|
7
|
+
"src/index.ts"
|
|
8
|
+
],
|
|
9
|
+
"sourcesContent": [
|
|
10
|
+
"// via radix-ui\n\nimport * as React from 'react'\n\nexport function usePrevious<T>(value: T): T {\n const ref = React.useRef({ value, previous: value })\n\n // We compare values before making an update to ensure that\n // a change has been made. This ensures the previous value is\n // persisted correctly between renders.\n return React.useMemo(() => {\n if (ref.current.value !== value) {\n ref.current.previous = ref.current.value\n ref.current.value = value\n }\n return ref.current.previous\n }, [value])\n}\n"
|
|
11
|
+
],
|
|
12
|
+
"version": 3
|
|
13
|
+
}
|