UNPKG

react-behave

Version:

A library of behaviors for React applications.

15 lines 414 B
export function callHandlers(event, handlers) { handlers.forEach(function (handler) { // Ingore falsy handlers to allow syntaxes like: // // ```js // const child = React.Children.only(this.props.children) // return React.cloneElement(child, { // onClick: e => callHandlers(e, [this.handleClick, child.onClick]) // }) // ``` if (handler) { handler(event); } }); }