Skip to content

Commit

Permalink
Merge pull request #657 from Macrox/fix/resolve-menu-item-with-forwar…
Browse files Browse the repository at this point in the history
…ding-ref

fix(Menu): Resolve items that created by `React.forwardRef`
  • Loading branch information
youluna authored May 14, 2019
2 parents a4b9b76 + 807d8de commit ebfc1a2
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/menu/view/menu.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,12 @@ export default class Menu extends Component {
return Children.map(children, child => {
if (
child &&
typeof child.type === 'function' &&
(typeof child.type === 'function' ||
// `React.forwardRef(render)` returns a forwarding
// object that includes `render` method, and the specific
// `child.type` will be an object instead of a class or
// function.
typeof child.type === 'object') &&
'menuChildType' in child.type
) {
let newChild;
Expand Down

0 comments on commit ebfc1a2

Please sign in to comment.