Skip to content

Commit

Permalink
Simplify renderAnchor typing
Browse files Browse the repository at this point in the history
  • Loading branch information
dgreif committed May 17, 2021
1 parent 8327403 commit 794ec9a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/SelectPanel/SelectPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {FilteredActionList, FilteredActionListProps} from '../FilteredActionList
import {OverlayProps} from '../Overlay'
import {ItemInput} from '../ActionList/List'
import {FocusZoneSettings} from '../behaviors/focusZone'
import {DropdownButton, DropdownButtonProps} from '../DropdownMenu'
import {DropdownButton} from '../DropdownMenu'
import {ItemProps} from '../ActionList'
import {AnchoredOverlay, AnchoredOverlayProps} from '../AnchoredOverlay'
import Flex from '../Flex'
Expand Down Expand Up @@ -57,7 +57,7 @@ const textInputProps: Partial<TextInputProps> = {
export function SelectPanel({
open,
setOpen,
renderAnchor = <T extends DropdownButtonProps>(props: T) => <DropdownButton {...props} />,
renderAnchor = props => <DropdownButton {...props} />,
placeholder,
selected,
setSelected,
Expand All @@ -76,8 +76,8 @@ export function SelectPanel({
[setFilter, setOpen]
)

const renderMenuAnchor = useCallback(
<T extends React.HTMLAttributes<HTMLElement>>(props: T) => {
const renderMenuAnchor: AnchoredOverlayProps['renderAnchor'] = useCallback(
props => {
const selectedItems = Array.isArray(selected) ? selected : [...(selected ? [selected] : [])]

return renderAnchor({
Expand Down

0 comments on commit 794ec9a

Please sign in to comment.