source: imaps-frontend/node_modules/react-use/esm/factory/createRenderProp.js@ d565449

main
Last change on this file since d565449 was d565449, checked in by stefan toskovski <stefantoska84@…>, 4 weeks ago

Update repo after prototype presentation

  • Property mode set to 100644
File size: 474 bytes
Line 
1var defaultMapPropsToArgs = function (props) { return [props]; };
2export default function createRenderProp(hook, mapPropsToArgs) {
3 if (mapPropsToArgs === void 0) { mapPropsToArgs = defaultMapPropsToArgs; }
4 return function RenderProp(props) {
5 var state = hook.apply(void 0, mapPropsToArgs(props));
6 var children = props.children, _a = props.render, render = _a === void 0 ? children : _a;
7 return render ? render(state) || null : null;
8 };
9}
Note: See TracBrowser for help on using the repository browser.