@vikadata/react-contexify
Advanced tools
Comparing version 4.1.4 to 4.1.5
@@ -6,2 +6,3 @@ "use strict"; | ||
var Item_1 = require("./Item"); | ||
var Submenu_1 = require("./Submenu"); | ||
function cloneItem(children, props) { | ||
@@ -14,3 +15,5 @@ return react_1.Children.map( | ||
} | ||
if (!(child.type === Item_1.Item) && child.props.children) { | ||
if (child.type !== Item_1.Item && | ||
child.type !== Submenu_1.Submenu && | ||
child.props.children) { | ||
return cloneItem(child.props.children, props); | ||
@@ -17,0 +20,0 @@ } |
{ | ||
"name": "@vikadata/react-contexify", | ||
"version": "4.1.4", | ||
"version": "4.1.5", | ||
"main": "lib/index.js", | ||
@@ -5,0 +5,0 @@ "typings": "./lib/index.d.ts", |
import { Children, cloneElement, ReactNode, ReactElement, isValidElement } from 'react'; | ||
import { TriggerEvent } from '../types'; | ||
import { Item } from './Item'; | ||
import { Submenu } from './Submenu'; | ||
@@ -14,3 +15,7 @@ export function cloneItem ( | ||
if (!isValidElement(child)) { return child } | ||
if (!(child.type === Item) && child.props.children) { | ||
if ( | ||
child.type !== Item && | ||
child.type !== Submenu && | ||
child.props.children | ||
) { | ||
return cloneItem(child.props.children, props) | ||
@@ -17,0 +22,0 @@ } |
Sorry, the diff of this file is not supported yet
193389
2685