Commit 84ef543e by Яков

add func renderHeaderColumn

parent 7bd49cc7
......@@ -86,5 +86,15 @@
},
"resolutions": {
"graceful-fs": "^4.2.4"
},
"babel": {
"presets": [
"@babel/preset-react",
"@babel/preset-env"
],
"plugins": [
"@babel/plugin-transform-react-jsx",
"@babel/plugin-proposal-class-properties"
]
}
}
......@@ -122,18 +122,22 @@ class ReactFinder extends PureComponent {
}
renderDetail() {
const {renderDetail, dataSource, nodeKey, childrenPropName} = this.props;
const {selectedKey} = this.state;
const { renderDetail, dataSource, nodeKey, childrenPropName } = this.props;
const { selectedKey } = this.state;
const el = renderDetail && renderDetail({
selectedKey,
selectedData: findInTree(
dataSource,
n => n[nodeKey] === selectedKey, {childrenName: childrenPropName}
n => n[nodeKey] === selectedKey, { childrenName: childrenPropName }
)
});
if (el) {
return (<div className="react-finder-detail">{el}</div>);
return (
<div className="react-finder-detail">
{el}
</div>
);
}
return null;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment