Skip to content

Commit

Permalink
feat(search): use React.forwardRef and deprecate inputRef prop
Browse files Browse the repository at this point in the history
allow a `ref` to be passed directly to the component, removing the need for the `inputRef` prop
which is now deprecated

re #5564
  • Loading branch information
robinzigmond committed Jan 18, 2023
1 parent 4d85bcf commit 2cd05f8
Show file tree
Hide file tree
Showing 3 changed files with 244 additions and 194 deletions.
4 changes: 1 addition & 3 deletions src/components/menu/menu-item/menu-item.component.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,7 @@ const MenuItem = ({
};

const clonedChildren = isChildSearch.current
? childrenItems.map((child) =>
React.cloneElement(child, { inputRef: childRef })
)
? childrenItems.map((child) => React.cloneElement(child, { ref: childRef }))
: children;

const getTitle = (title) =>
Expand Down
Loading

0 comments on commit 2cd05f8

Please sign in to comment.