Skip to content

Instantly share code, notes, and snippets.

@WesSouza
Created August 19, 2022 11:35
Show Gist options
  • Save WesSouza/9d09aecc916c3ab8c82934615a848007 to your computer and use it in GitHub Desktop.
Save WesSouza/9d09aecc916c3ab8c82934615a848007 to your computer and use it in GitHub Desktop.
prop getter function returned by hooks thingy
export Google({ customAriaLabelForSomeReason }) {
const { getInputProps, options } = useGoogle();
const inputProps = getInputProps({ 'aria-label': customAriaLabelForSomeReason })
return (
<div>
<input {...inputProps} />
{options.length ? <div>{options.map(...)}</div> : ''}
</div>
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment