react-simplikit 0.0.33 → 0.0.35
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.
|
@@ -14,15 +14,15 @@ type Props<Case> = {
|
|
|
14
14
|
* similar to a `switch-case` statement. It is useful when you need to conditionally render different
|
|
15
15
|
* components depending on a specific state.
|
|
16
16
|
*
|
|
17
|
-
* @param {
|
|
17
|
+
* @param {Case} value - The value to compare against.
|
|
18
18
|
* The component associated with the matching key in `caseBy` will be rendered.
|
|
19
|
-
* @param {
|
|
19
|
+
* @param {Partial<{ [P in StringifiedValue<Case>]: () => ReactElement | null }>} caseBy - An object that maps values to
|
|
20
20
|
* components to render. The keys represent possible values, and the values are functions returning
|
|
21
21
|
* the corresponding components.
|
|
22
|
-
* @param {() =>
|
|
22
|
+
* @param {() => ReactElement | null} [defaultComponent] - The component to render if `value` does not match
|
|
23
23
|
* any key in `caseBy`.
|
|
24
24
|
*
|
|
25
|
-
* @returns {
|
|
25
|
+
* @returns {ReactElement | null} A React component that conditionally renders based on cases.
|
|
26
26
|
*
|
|
27
27
|
* @example
|
|
28
28
|
* function App() {
|
package/dist/index.cjs
CHANGED
|
@@ -14,15 +14,15 @@ type Props<Case> = {
|
|
|
14
14
|
* similar to a `switch-case` statement. It is useful when you need to conditionally render different
|
|
15
15
|
* components depending on a specific state.
|
|
16
16
|
*
|
|
17
|
-
* @param {
|
|
17
|
+
* @param {Case} value - The value to compare against.
|
|
18
18
|
* The component associated with the matching key in `caseBy` will be rendered.
|
|
19
|
-
* @param {
|
|
19
|
+
* @param {Partial<{ [P in StringifiedValue<Case>]: () => ReactElement | null }>} caseBy - An object that maps values to
|
|
20
20
|
* components to render. The keys represent possible values, and the values are functions returning
|
|
21
21
|
* the corresponding components.
|
|
22
|
-
* @param {() =>
|
|
22
|
+
* @param {() => ReactElement | null} [defaultComponent] - The component to render if `value` does not match
|
|
23
23
|
* any key in `caseBy`.
|
|
24
24
|
*
|
|
25
|
-
* @returns {
|
|
25
|
+
* @returns {ReactElement | null} A React component that conditionally renders based on cases.
|
|
26
26
|
*
|
|
27
27
|
* @example
|
|
28
28
|
* function App() {
|
package/esm/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-simplikit",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.35",
|
|
4
4
|
"main": "./dist/index.cjs",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -99,8 +99,7 @@
|
|
|
99
99
|
"vue": "^3.5.13"
|
|
100
100
|
},
|
|
101
101
|
"peerDependencies": {
|
|
102
|
-
"react": "*"
|
|
103
|
-
"react-dom": "*"
|
|
102
|
+
"react": "*"
|
|
104
103
|
},
|
|
105
104
|
"packageManager": "yarn@4.5.3",
|
|
106
105
|
"module": "./esm/index.js",
|