-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pass props to valueComponent #1208
Comments
You could use an approach like this: function createGravatarValue (yourProps) {
return function GravatarValueWrapper (selectProps) {
// Has access to all your custom props (yourProps)
// As well as those provided by Select (selectProps)
return (
<GravatarValue
{...yourProps}
{...selectProps}
/>
)
}
}
function createSelect (selectProps) {
const GravatarValueWrapper = createGravatarValue({
// Whatever props you want to pass outside of Select
})
return (
<Select
{...selectProps}
valueComponent={GravatarValueWrapper}
/>
)
} |
Essentially, wrap the props you want to pass (outside of Cheers! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
in my Select component I have sth like:
My problem is that I can't pass props to
GravatarValue
. how can I do that?The text was updated successfully, but these errors were encountered: