Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
wrapChild(child, index) {
const wrappedCallBack = (node) => {
this.updateHeight(node, index);
if (child.props.refCallback) {
child.props.refCallback(node);
}
};
let newProps = {};
if (this.props.isSelectable) {
const wrappedOnClick = SelectableUtils.wrappedOnClickForRow(child, index, this.props.onChange);
const wrappedOnKeyDown = SelectableUtils.wrappedOnKeyDownForRow(child, index, this.props.onChange);
newProps = SelectableUtils.newPropsForRow(child, index, wrappedOnClick, wrappedOnKeyDown, this.props.selectedIndexes, this.props.disableUnselectedItems);
}
newProps.refCallback = wrappedCallBack;
newProps['data-infinite-table-index'] = index;
newProps.style = child.props.style ? Object.assign({}, child.props.style, { overflow: 'hidden' }) : { overflow: 'hidden' };
return React.cloneElement(child, newProps);
}