@chhsiao1981/use-thunk 10.0.2 → 10.0.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 +1 -1
- package/src/ThunkContext.tsx +4 -3
- package/types/ThunkContext.d.ts +3 -3
package/package.json
CHANGED
package/src/ThunkContext.tsx
CHANGED
|
@@ -1,17 +1,18 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type JSX, useMemo, useState } from 'react'
|
|
2
2
|
import type { ClassState } from './stateTypes'
|
|
3
3
|
import { THUNK_CONTEXT_MAP } from './thunkContextMap'
|
|
4
4
|
|
|
5
5
|
type Props = {
|
|
6
6
|
classes?: string[]
|
|
7
|
-
children?:
|
|
7
|
+
children?: JSX.Element
|
|
8
8
|
}
|
|
9
|
-
const ThunkContext = (props: Props) => {
|
|
9
|
+
const ThunkContext = (props: Props): JSX.Element => {
|
|
10
10
|
let { classes, children } = props
|
|
11
11
|
if (!classes) {
|
|
12
12
|
classes = THUNK_CONTEXT_MAP.theList
|
|
13
13
|
}
|
|
14
14
|
if (classes.length === 0) {
|
|
15
|
+
// @ts-expect-error with children
|
|
15
16
|
return children
|
|
16
17
|
}
|
|
17
18
|
|
package/types/ThunkContext.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type JSX } from 'react';
|
|
2
2
|
type Props = {
|
|
3
3
|
classes?: string[];
|
|
4
|
-
children?:
|
|
4
|
+
children?: JSX.Element;
|
|
5
5
|
};
|
|
6
|
-
declare const ThunkContext: (props: Props) =>
|
|
6
|
+
declare const ThunkContext: (props: Props) => JSX.Element;
|
|
7
7
|
export default ThunkContext;
|