Skip to content

Can't access innerRef of SelectContainer #5098

Answered by Rall3n
florinpavel22 asked this question in Q&A
Discussion options

You must be logged in to vote

@florinpavel22

A look into the documentation would have been enough to see that the SelectContainer component has no prop called innerRef.

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.

const SelectContainer = ({innerProps, ...props}) => {
  /* ... */

  return <components.SelectContainer
    {...props}
    innerProps={{...innerProps, ref: YOURREF}}
  />
}

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@florinpavel22
Comment options

@Rall3n
Comment options

Rall3n Mar 11, 2022
Collaborator

@florinpavel22
Comment options

Answer selected by florinpavel22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants