Skip to content

Commit

Permalink
docs: fix type @logicflow/react-node-registry
Browse files Browse the repository at this point in the history
  • Loading branch information
boyongjiong authored Sep 3, 2024
1 parent 2ee2f5e commit b80884b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sites/docs/docs/tutorial/advanced/react.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ tag: New
## Rendering React Components as Node Content
Although we provide the capability to customize nodes by extending `HTMLNode`, user feedback indicates that this approach is not very intuitive and may cause performance issues due to improper destruction timing.

Therefore, we offer a separate package `@logiclfow/react-node-registry` to customize nodes in a more intuitive way by registering nodes through React components. This allows you to use the rich component libraries already included in the system or to quickly develop custom node content using React's convenient development features.
Therefore, we offer a separate package `@logicflow/react-node-registry` to customize nodes in a more intuitive way by registering nodes through React components. This allows you to use the rich component libraries already included in the system or to quickly develop custom node content using React's convenient development features.

```tsx | pure
import { register, ReactNodeProps } from '@logicflow/react-node-registry'
Expand Down Expand Up @@ -103,4 +103,4 @@ root.render(elem)

As a result, the React component is no longer part of the normal rendering document tree. This means it cannot access external Context content. If you have such use cases, you can use the `Portal` mode to render React components.

<code id="react-portal" src="@/src/tutorial/advanced/react/Portal.tsx"></code>
<code id="react-portal" src="@/src/tutorial/advanced/react/Portal.tsx"></code>

0 comments on commit b80884b

Please sign in to comment.