correct suppressRefError (#198)

### TL;DR

This PR refactors the `UserSelect` component, adjusting the call to `getToggleButtonProps`.

### What changed?

The `getToggleButtonProps` method in the `UserSelect` component now takes in two separate objects, one for the `ref` and another for `suppressRefError`, instead of a single one.

### How to test?

Verify the component functionality hasn't changed and there are no reference errors.

### Why make this change?

This code changes improve the readability and maintainability of this component by clearly separating the component reference and error suppression configurations in separate objects.
This commit is contained in:
Vivian Phung 2024-05-22 15:02:51 -04:00 committed by GitHub
parent b35f4033c5
commit 7b5ba1a5d0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -103,10 +103,12 @@ export const UserSelect = ({ options, value }: UserSelectProps) => {
<div className={theme.container()}> <div className={theme.container()}>
{/* Input */} {/* Input */}
<div <div
{...getToggleButtonProps({ {...getToggleButtonProps(
{
ref: inputWrapperRef, ref: inputWrapperRef,
suppressRefError: true, },
})} { suppressRefError: true },
)}
onClick={() => !dropdownOpen && openMenu()} onClick={() => !dropdownOpen && openMenu()}
className="cursor-pointer relative py-2 pl-2 pr-4 flex min-w-[200px] w-full items-center justify-between rounded-xl bg-surface-card shadow-sm" className="cursor-pointer relative py-2 pl-2 pr-4 flex min-w-[200px] w-full items-center justify-between rounded-xl bg-surface-card shadow-sm"
> >