@codeleap/hooks 5.8.3 → 5.8.4

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": "@codeleap/hooks",
3
- "version": "5.8.3",
3
+ "version": "5.8.4",
4
4
  "main": "src/index.ts",
5
5
  "license": "UNLICENSED",
6
6
  "repository": {
@@ -9,22 +9,22 @@
9
9
  "directory": "packages/hooks"
10
10
  },
11
11
  "devDependencies": {
12
- "@codeleap/config": "5.8.3",
13
- "@codeleap/types": "5.8.3",
14
- "@codeleap/utils": "5.8.3",
15
- "@codeleap/logger": "5.8.3",
12
+ "@codeleap/config": "5.8.4",
13
+ "@codeleap/types": "5.8.4",
14
+ "@codeleap/utils": "5.8.4",
15
+ "@codeleap/logger": "5.8.4",
16
16
  "ts-node-dev": "1.1.8"
17
17
  },
18
18
  "scripts": {
19
19
  "build": "echo 'No build needed'"
20
20
  },
21
21
  "peerDependencies": {
22
- "@codeleap/types": "5.8.3",
23
- "@codeleap/utils": "5.8.3",
24
- "@codeleap/logger": "5.8.3",
22
+ "@codeleap/types": "5.8.4",
23
+ "@codeleap/utils": "5.8.4",
24
+ "@codeleap/logger": "5.8.4",
25
25
  "axios": "^1.7.9",
26
26
  "typescript": "5.5.2",
27
27
  "react": "18.2.0",
28
- "@tanstack/react-query": "5.60.6"
28
+ "@tanstack/react-query": "5.89.0"
29
29
  }
30
30
  }
package/package.json.bak CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codeleap/hooks",
3
- "version": "5.8.3",
3
+ "version": "5.8.4",
4
4
  "main": "src/index.ts",
5
5
  "license": "UNLICENSED",
6
6
  "repository": {
@@ -25,6 +25,6 @@
25
25
  "axios": "^1.7.9",
26
26
  "typescript": "5.5.2",
27
27
  "react": "18.2.0",
28
- "@tanstack/react-query": "5.60.6"
28
+ "@tanstack/react-query": "5.89.0"
29
29
  }
30
30
  }
package/src/useId.ts CHANGED
@@ -1,8 +1,8 @@
1
- import { useRef } from 'react'
2
- import uuid from 'react-native-uuid'
1
+ import { useRef, useId as _useId } from 'react'
3
2
 
4
- export function useId(id = uuid.v4()) {
3
+ export function useId<T>(id?: T) {
4
+ const defaultId = _useId()
5
5
  const idRef = useRef(id)
6
6
 
7
- return idRef.current as unknown as string
7
+ return idRef.current ?? defaultId
8
8
  }