main
Last change
on this file 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 | |
---|
1 | var defaultMapPropsToArgs = function (props) { return [props]; };
|
---|
2 | export 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.