Can't access innerRef
of SelectContainer
#5098
Answered
by
Rall3n
florinpavel22
asked this question in
Q&A
-
Hi, I have this custom SelectContainer component.
And I cannot access its ref. I tried logging to the console, but nothing. |
Beta Was this translation helpful? Give feedback.
Answered by
Rall3n
Mar 11, 2022
Replies: 1 comment 3 replies
-
A look into the documentation would have been enough to see that the I suggest you use the prop const SelectContainer = ({innerProps, ...props}) => {
/* ... */
return <components.SelectContainer
{...props}
innerProps={{...innerProps, ref: YOURREF}}
/>
} |
Beta Was this translation helpful? Give feedback.
3 replies
Answer selected by
florinpavel22
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@florinpavel22
A look into the documentation would have been enough to see that the
SelectContainer
component has no prop calledinnerRef
.I suggest you use the prop
innerProps
instead to assign the reference.innerProps
is a set of props that is being spread onto the underlying element.