Commit 2a647a7
Ensure refs are forwarded when freezing data (#3390)
We were wrapping rendered children in `<Frozen>` in a combobox however
the refs weren't being forwarded through the internal `<Frozen>`
component resulting in issues when rendering `<ComboboxOptions>` as a
`Fragment`.
After this PR the following code no longer warns about function
components not accepting refs.
```tsx
import { Combobox, ComboboxInput, ComboboxOption, ComboboxOptions } from '@headlessui/react'
import React from 'react'
export default function Example() {
return (
<div className="p-4">
<Combobox>
<ComboboxInput className="rounded border border-neutral-400 p-2" />
<ComboboxOptions as={React.Fragment}>
<div className="bg-orange-500 p-4">
<ComboboxOption value="a">A</ComboboxOption>
</div>
</ComboboxOptions>
</Combobox>
</div>
)
}
```
Fixes #3384
---------
Co-authored-by: Robin Malfait <[email protected]>1 parent da2fa94 commit 2a647a7
File tree
2 files changed
+13
-2
lines changed- packages/@headlessui-react
- src/internal
2 files changed
+13
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
4 | 7 | | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
5 | 13 | | |
6 | 14 | | |
7 | 15 | | |
| 16 | + | |
| 17 | + | |
8 | 18 | | |
9 | 19 | | |
10 | 20 | | |
| |||
0 commit comments