You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"description": "The React element or a function that returns one to override the default element."
9
8
},
10
9
"ref": {
@@ -33,6 +32,12 @@
33
32
"default": "true",
34
33
"description": "If `false`, the hook will skip most of its internal logic and return `null`.\nThis is useful for rendering a component conditionally.",
Copy file name to clipboardExpand all lines: docs/src/app/(public)/(content)/react/utils/use-render/page.mdx
+20-8Lines changed: 20 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -31,6 +31,11 @@ The `useRender` hook lets you build custom components that provide a `render` pr
31
31
description:
32
32
'The state of the component. It will be used as a parameter for the render callback.',
33
33
},
34
+
defaultTagName: {
35
+
type: 'keyof React.JSX.IntrinsicElements',
36
+
description:
37
+
'The default tag name to use for the rendered element when `render` is not provided.',
38
+
},
34
39
}}
35
40
/>
36
41
@@ -97,11 +102,12 @@ When building custom components, you often need to control a ref internally whil
97
102
98
103
In React 19, `React.forwardRef()` is not needed when building primitive components, as the external ref prop is already contained inside `props`. Your internal ref can be passed to `ref` to be merged with `props.ref`:
99
104
100
-
```tsx title="React 19" {5} "internalRef"
101
-
function Text({ render= <p />, ...props }:TextProps) {
0 commit comments