@vikadata/react-contexify
Advanced tools
Comparing version 4.1.3 to 4.1.4
@@ -13,3 +13,3 @@ "use strict"; | ||
} | ||
if (!(child.type === Item_1.Item)) { | ||
if (!(child.type === Item_1.Item) && child.props.children) { | ||
return cloneItem(child.props.children, props); | ||
@@ -16,0 +16,0 @@ } |
@@ -1,2 +0,3 @@ | ||
import { Component, ReactNode } from 'react'; | ||
import React, { Component, ReactNode } from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import { MenuItemEventHandler, StyleProps, InternalProps } from '../types'; | ||
@@ -25,10 +26,10 @@ export interface ItemProps extends StyleProps, InternalProps { | ||
static propTypes: { | ||
children: any; | ||
data: any; | ||
disabled: any; | ||
onClick: any; | ||
nativeEvent: any; | ||
propsFromTrigger: any; | ||
className: any; | ||
style: any; | ||
children: PropTypes.Validator<string | number | boolean | {} | PropTypes.ReactElementLike | PropTypes.ReactNodeArray>; | ||
data: PropTypes.Requireable<object>; | ||
disabled: PropTypes.Requireable<boolean | ((...args: any[]) => any)>; | ||
onClick: PropTypes.Requireable<(...args: any[]) => any>; | ||
nativeEvent: PropTypes.Requireable<object>; | ||
propsFromTrigger: PropTypes.Requireable<object>; | ||
className: PropTypes.Requireable<string>; | ||
style: PropTypes.Requireable<object>; | ||
}; | ||
@@ -41,5 +42,5 @@ static defaultProps: { | ||
constructor(props: ItemProps); | ||
handleClick: (e: any) => void; | ||
render(): any; | ||
handleClick: (e: React.MouseEvent) => void; | ||
render(): JSX.Element; | ||
} | ||
export { Item }; |
@@ -1,2 +0,2 @@ | ||
import { Component, ReactNode } from 'react'; | ||
import React, { Component, ReactNode } from 'react'; | ||
import PropTypes from 'prop-types'; | ||
@@ -43,3 +43,3 @@ import { TriggerEvent, StyleProps, MenuId } from '../types'; | ||
static propTypes: { | ||
id: PropTypes.Validator<MenuId>; | ||
id: PropTypes.Validator<React.ReactText>; | ||
children: PropTypes.Validator<string | number | boolean | {} | PropTypes.ReactElementLike | PropTypes.ReactNodeArray>; | ||
@@ -46,0 +46,0 @@ theme: PropTypes.Requireable<string>; |
@@ -1,2 +0,3 @@ | ||
import { Component, ReactNode } from 'react'; | ||
import { Component, ReactNode, SyntheticEvent } from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import { MenuId, StyleProps } from '../types'; | ||
@@ -37,11 +38,11 @@ export interface MenuProviderProps extends StyleProps { | ||
static propTypes: { | ||
id: any; | ||
children: any; | ||
component: any; | ||
render: any; | ||
event: any; | ||
className: any; | ||
style: any; | ||
storeRef: any; | ||
data: any; | ||
id: PropTypes.Validator<import("react").ReactText>; | ||
children: PropTypes.Validator<string | number | boolean | {} | PropTypes.ReactElementLike | PropTypes.ReactNodeArray>; | ||
component: PropTypes.Requireable<string | number | boolean | {} | PropTypes.ReactElementLike | PropTypes.ReactNodeArray>; | ||
render: PropTypes.Requireable<(...args: any[]) => any>; | ||
event: PropTypes.Requireable<string>; | ||
className: PropTypes.Requireable<string>; | ||
style: PropTypes.Requireable<object>; | ||
storeRef: PropTypes.Requireable<boolean>; | ||
data: PropTypes.Requireable<object>; | ||
}; | ||
@@ -53,8 +54,8 @@ static defaultProps: { | ||
}; | ||
childrenRefs: {}; | ||
handleEvent: (e: any) => void; | ||
setChildRef: (ref: any) => any; | ||
getChildren(): any; | ||
render(): any; | ||
childrenRefs: HTMLElement[]; | ||
handleEvent: (e: SyntheticEvent) => void; | ||
setChildRef: (ref: HTMLElement) => number | true; | ||
getChildren(): {}[] | null | undefined; | ||
render(): {} | null | undefined; | ||
} | ||
export { MenuProvider }; |
@@ -8,7 +8,7 @@ import { PureComponent, ReactNode } from 'react'; | ||
}; | ||
container: any; | ||
container: HTMLDivElement; | ||
componentDidMount(): void; | ||
componentWillUnmount(): void; | ||
render(): any; | ||
render(): false | import("react").ReactPortal; | ||
} | ||
export { Portal }; |
{ | ||
"name": "@vikadata/react-contexify", | ||
"version": "4.1.3", | ||
"version": "4.1.4", | ||
"main": "lib/index.js", | ||
@@ -5,0 +5,0 @@ "typings": "./lib/index.d.ts", |
@@ -14,3 +14,3 @@ import { Children, cloneElement, ReactNode, ReactElement, isValidElement } from 'react'; | ||
if (!isValidElement(child)) { return child } | ||
if (!(child.type === Item)) { | ||
if (!(child.type === Item) && child.props.children) { | ||
return cloneItem(child.props.children, props) | ||
@@ -17,0 +17,0 @@ } |
Sorry, the diff of this file is not supported yet
193169
2677