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 4, 2023
1 parent 23fac7e commit f73799c
Show file tree
Hide file tree
Showing 3 changed files with 251 additions and 192 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 f73799c

Please sign in to comment.