Skip to content

Commit c1760fd

Browse files
committed
feat(react): add Suspense component and JSDoc for Activity and Suspense
1 parent 97d10d1 commit c1760fd

File tree

1 file changed

+31
-1
lines changed

1 file changed

+31
-1
lines changed

src/components/react.node.ts

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,34 @@
1-
import { Activity as BaseActivity } from 'react'
1+
import { Activity as BaseActivity, Suspense as BaseSuspense } from 'react'
22
import { createNode } from '@src/core.node.js'
33

4+
/**
5+
* Lets you hide and restore the UI and internal state of its children.
6+
* @see {@link https://react.dev/reference/react/Activity React Docs}
7+
* @example
8+
*
9+
* ```typescript
10+
* import { Activity } from '@meonode/ui';
11+
*
12+
* Activity({
13+
* mode: isShowingSidebar ? "visible" : "hidden",
14+
* children: Div(...),
15+
* })
16+
* ```
17+
*/
418
export const Activity = createNode(BaseActivity)
19+
20+
/**
21+
* Lets you display a fallback until its children have finished loading.
22+
* @see {@link https://react.dev/reference/react/Suspense React Docs}
23+
* @example
24+
*
25+
* ```typescript
26+
* import { Suspense } from '@meonode/ui';
27+
*
28+
* Suspense({
29+
* fallback: 'Loading...',
30+
* children: Div(...),
31+
* })
32+
* ```
33+
*/
34+
export const Suspense = createNode(BaseSuspense)

0 commit comments

Comments
 (0)