@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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chhsiao1981/use-thunk",
3
- "version": "10.0.2",
3
+ "version": "10.0.4",
4
4
  "type": "module",
5
5
  "description": "A framework easily using useThunk to manage the data-state.",
6
6
  "homepage": "https://github.com/chhsiao1981/use-thunk",
@@ -1,17 +1,18 @@
1
- import { type ReactNode, useMemo, useState } from 'react'
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?: ReactNode
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
 
@@ -1,7 +1,7 @@
1
- import { type ReactNode } from 'react';
1
+ import { type JSX } from 'react';
2
2
  type Props = {
3
3
  classes?: string[];
4
- children?: ReactNode;
4
+ children?: JSX.Element;
5
5
  };
6
- declare const ThunkContext: (props: Props) => string | number | bigint | boolean | Iterable<ReactNode> | Promise<string | number | bigint | boolean | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | import("react").ReactPortal | Iterable<ReactNode> | null | undefined> | import("react/jsx-runtime").JSX.Element | null | undefined;
6
+ declare const ThunkContext: (props: Props) => JSX.Element;
7
7
  export default ThunkContext;