react-simplikit 0.0.19 → 0.0.21
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.
|
@@ -5,6 +5,8 @@ type NotNullishValue = {};
|
|
|
5
5
|
* when it hasn't changed, while ensuring you can safely use the latest state.
|
|
6
6
|
* It prevents unnecessary re-renders while always allowing access to the latest data.
|
|
7
7
|
*
|
|
8
|
+
* @template {NotNullishValue} T - The type of target to be referenced.
|
|
9
|
+
*
|
|
8
10
|
* @param {T} value - The value to maintain the reference for. It returns a new reference
|
|
9
11
|
* if the state value changes after comparison.
|
|
10
12
|
* @param {(a: T, b: T) => boolean} [areValuesEqual] - An optional function to determine
|
|
@@ -5,6 +5,8 @@ import { RefObject, RefCallback } from 'react';
|
|
|
5
5
|
* This function takes multiple refs (RefObject or RefCallback) and returns a single ref that updates all provided refs.
|
|
6
6
|
* It's useful when you need to pass multiple refs to a single element.
|
|
7
7
|
*
|
|
8
|
+
* @template T - The type of target to be referenced.
|
|
9
|
+
*
|
|
8
10
|
* @param {Array<RefObject<T> | RefCallback<T> | null | undefined>} refs - An array of refs to be merged. Each ref can be either a RefObject or RefCallback.
|
|
9
11
|
*
|
|
10
12
|
* @returns {RefCallback<T>} A single ref callback that updates all provided refs.
|
|
@@ -5,6 +5,8 @@ type NotNullishValue = {};
|
|
|
5
5
|
* when it hasn't changed, while ensuring you can safely use the latest state.
|
|
6
6
|
* It prevents unnecessary re-renders while always allowing access to the latest data.
|
|
7
7
|
*
|
|
8
|
+
* @template {NotNullishValue} T - The type of target to be referenced.
|
|
9
|
+
*
|
|
8
10
|
* @param {T} value - The value to maintain the reference for. It returns a new reference
|
|
9
11
|
* if the state value changes after comparison.
|
|
10
12
|
* @param {(a: T, b: T) => boolean} [areValuesEqual] - An optional function to determine
|
|
@@ -5,6 +5,8 @@ import { RefObject, RefCallback } from 'react';
|
|
|
5
5
|
* This function takes multiple refs (RefObject or RefCallback) and returns a single ref that updates all provided refs.
|
|
6
6
|
* It's useful when you need to pass multiple refs to a single element.
|
|
7
7
|
*
|
|
8
|
+
* @template T - The type of target to be referenced.
|
|
9
|
+
*
|
|
8
10
|
* @param {Array<RefObject<T> | RefCallback<T> | null | undefined>} refs - An array of refs to be merged. Each ref can be either a RefObject or RefCallback.
|
|
9
11
|
*
|
|
10
12
|
* @returns {RefCallback<T>} A single ref callback that updates all provided refs.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-simplikit",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.21",
|
|
4
4
|
"main": "./dist/index.cjs",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
"esm/**/*"
|
|
20
20
|
],
|
|
21
21
|
"scripts": {
|
|
22
|
+
"clean": "rimraf ./dist ./esm ./coverage ./node_modules",
|
|
22
23
|
"scaffold": "tsx .scripts/index.ts scaffold",
|
|
23
24
|
"docs:gen": "tsx .scripts/index.ts generate-docs",
|
|
24
25
|
"docs:dev": "vitepress dev",
|
|
@@ -88,6 +89,7 @@
|
|
|
88
89
|
"prettier-plugin-sort-re-exports": "^0.1.0",
|
|
89
90
|
"react": "^19.0.0",
|
|
90
91
|
"react-dom": "^19.0.0",
|
|
92
|
+
"rimraf": "^6.0.1",
|
|
91
93
|
"tsup": "^8.3.5",
|
|
92
94
|
"tsx": "^4.19.2",
|
|
93
95
|
"typescript": "^5.7.2",
|