Skip to content

Commit 8e1ceec

Browse files
authored
Merge pull request #2970 from jer3m01/chore/type
chore: update component types to accept ref array
2 parents a60b288 + 15b512f commit 8e1ceec

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

.changeset/fuzzy-queens-retire.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"solid-js": patch
3+
---
4+
5+
Accept ref array in component ref type

packages/solid/src/client/component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ export type ComponentProps<T extends ValidComponent> = T extends Component<infer
6363
*
6464
* @example Component<{ref: Ref<Element>}>
6565
*/
66-
export type Ref<T> = T | ((val: T) => void);
66+
export type Ref<T> = T | ((val: T) => void) | undefined | Ref<T>[];
6767

6868
/**
6969
* Invokes a component, wrapping the call in `untrack` so that reactive reads

0 commit comments

Comments
 (0)