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
Copy file name to clipboardExpand all lines: src/routes/reference/jsx-attributes/ref.mdx
+7-3Lines changed: 7 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -24,14 +24,14 @@ description: >-
24
24
25
25
-**Type:** variable binding or callback function
26
26
27
-
Receives the rendered element or forwarded ref value.
27
+
For DOM elements, variable refs are assigned during render and callback refs receive the element.
28
28
29
29
## Behavior
30
30
31
31
- Refs are assigned during rendering before the element is connected to the DOM.
32
32
- A variable ref assigns the rendered element to the referenced variable.
33
-
- A callback ref is called with the rendered element.
34
-
- Component refs work only when the component forwards the `ref` prop to an underlying element or child component.
33
+
- A callback ref is called with the rendered element. When `ref` comes through a spread, functional refs are invoked from the spread handling path instead.
34
+
- Component refs work only when the component uses or forwards the `ref` prop to an underlying element or child component.
0 commit comments