Skip to content

Commit aca20d4

Browse files
committed
Bump Fragment refs docs to canary
1 parent c39f71e commit aca20d4

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/content/reference/react/Fragment.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ title: <Fragment> (<>...</>)
66

77
`<Fragment>`, often used via `<>...</>` syntax, lets you group elements without a wrapper node.
88

9-
<Experimental> Fragments can also accept refs, which enable interacting with underlying DOM nodes without adding wrapper elements. See reference and usage below.</Experimental>
9+
<Canary> Fragments can also accept refs, which enable interacting with underlying DOM nodes without adding wrapper elements. See reference and usage below.</Canary>
1010

1111
```js
1212
<>
@@ -30,9 +30,9 @@ Wrap elements in `<Fragment>` to group them together in situations where you nee
3030
#### Props {/*props*/}
3131

3232
- **optional** `key`: Fragments declared with the explicit `<Fragment>` syntax may have [keys.](/learn/rendering-lists#keeping-list-items-in-order-with-key)
33-
- <ExperimentalBadge /> **optional** `ref`: A ref object (e.g. from [`useRef`](/reference/react/useRef)) or [callback function](/reference/react-dom/components/common#ref-callback). React provides a `FragmentInstance` as the ref value that implements methods for interacting with the DOM nodes wrapped by the Fragment.
33+
- <CanaryBadge /> **optional** `ref`: A ref object (e.g. from [`useRef`](/reference/react/useRef)) or [callback function](/reference/react-dom/components/common#ref-callback). React provides a `FragmentInstance` as the ref value that implements methods for interacting with the DOM nodes wrapped by the Fragment.
3434

35-
### <ExperimentalBadge /> FragmentInstance {/*fragmentinstance*/}
35+
### <CanaryBadge /> FragmentInstance {/*fragmentinstance*/}
3636

3737
When you pass a ref to a fragment, React provides a `FragmentInstance` object with methods for interacting with the DOM nodes wrapped by the fragment:
3838

@@ -64,7 +64,7 @@ When you pass a ref to a fragment, React provides a `FragmentInstance` object wi
6464

6565
- React does not [reset state](/learn/preserving-and-resetting-state) when you go from rendering `<><Child /></>` to `[<Child />]` or back, or when you go from rendering `<><Child /></>` to `<Child />` and back. This only works a single level deep: for example, going from `<><><Child /></></>` to `<Child />` resets the state. See the precise semantics [here.](https://gist.github.com/clemmy/b3ef00f9507909429d8aa0d3ee4f986b)
6666

67-
- <ExperimentalBadge /> If you want to pass `ref` to a Fragment, you can't use the `<>...</>` syntax. You have to explicitly import `Fragment` from `'react'` and render `<Fragment ref={yourRef}>...</Fragment>`.
67+
- <CanaryBadge /> If you want to pass `ref` to a Fragment, you can't use the `<>...</>` syntax. You have to explicitly import `Fragment` from `'react'` and render `<Fragment ref={yourRef}>...</Fragment>`.
6868

6969
---
7070

@@ -242,7 +242,7 @@ function PostBody({ body }) {
242242
243243
---
244244
245-
### <ExperimentalBadge /> Using Fragment refs for DOM interaction {/*using-fragment-refs-for-dom-interaction*/}
245+
### <CanaryBadge /> Using Fragment refs for DOM interaction {/*using-fragment-refs-for-dom-interaction*/}
246246
247247
Fragment refs allow you to interact with the DOM nodes wrapped by a Fragment without adding extra wrapper elements. This is useful for event handling, visibility tracking, focus management, and replacing deprecated patterns like `ReactDOM.findDOMNode()`.
248248
@@ -262,7 +262,7 @@ function ClickableFragment({ children, onClick }) {
262262
```
263263
---
264264
265-
### <ExperimentalBadge /> Tracking visibility with Fragment refs {/*tracking-visibility-with-fragment-refs*/}
265+
### <CanaryBadge /> Tracking visibility with Fragment refs {/*tracking-visibility-with-fragment-refs*/}
266266
267267
Fragment refs are useful for visibility tracking and intersection observation. This enables you to monitor when content becomes visible without requiring the child Components to expose refs:
268268
@@ -309,7 +309,7 @@ This pattern is an alternative to Effect-based visibility logging, which is an a
309309
310310
---
311311
312-
### <ExperimentalBadge /> Focus management with Fragment refs {/*focus-management-with-fragment-refs*/}
312+
### <CanaryBadge /> Focus management with Fragment refs {/*focus-management-with-fragment-refs*/}
313313
314314
Fragment refs provide focus management methods that work across all DOM nodes within the Fragment:
315315

0 commit comments

Comments
 (0)