diff --git a/src/components/charts/bubble/BubblePlaceholders.js b/src/components/charts/bubble/BubblePlaceholders.js index 987c70279..62a3fdb26 100644 --- a/src/components/charts/bubble/BubblePlaceholders.js +++ b/src/components/charts/bubble/BubblePlaceholders.js @@ -123,22 +123,28 @@ export default class BubblePlaceholders extends Component { } if (!animate) { - return React.createElement( - wrapperTag, - wrapperProps, - React.createElement( - containerTag, - containerProps, - children( - nodes.map(node => { - return { - key: node.data.key, - data: node, - style: _.pick(node, ['r', 'x', 'y', 'color']), - } - }) - ) - ) + return ( + + {({ showTooltip, hideTooltip }) => + React.createElement( + wrapperTag, + wrapperProps, + React.createElement( + containerTag, + containerProps, + children( + nodes.map(node => { + return { + key: node.data.key, + data: node, + style: _.pick(node, ['r', 'x', 'y', 'color']), + } + }), + { showTooltip, hideTooltip } + ) + ) + )} + ) } diff --git a/src/hocs/withColors.js b/src/hocs/withColors.js index 96756e2b8..052744e50 100644 --- a/src/hocs/withColors.js +++ b/src/hocs/withColors.js @@ -10,7 +10,7 @@ import withPropsOnChange from 'recompose/withPropsOnChange' import { getColorsGenerator } from '../lib/colorUtils' /** - * This HOC takes watch colors related props change + * This HOC watch colors related props change * and returns the corresponding color generator function. * Using it prevent from having a new ref each time * we pass through the component, useful for shallow comparison. diff --git a/src/lib/decoratorsFromReactChildren.js b/src/lib/decoratorsFromReactChildren.js deleted file mode 100644 index 8a99e8d8b..000000000 --- a/src/lib/decoratorsFromReactChildren.js +++ /dev/null @@ -1,26 +0,0 @@ -/* - * This file is part of the nivo project. - * - * Copyright 2016-present, Raphaƫl Benitte. - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -import React from 'react' - -const decoratorsFromReactChildren = (children, type) => { - const decorators = [] - - React.Children.forEach(children, element => { - if (React.isValidElement(element)) { - if (element.type[type]) { - decorators.push(element.type[type](element)) - } - } - }) - - return decorators -} - -export default decoratorsFromReactChildren