informed
Version:
A lightweight framework and utility for building powerful forms in React applications
28 lines (25 loc) • 973 B
JavaScript
import { objectWithoutProperties as _objectWithoutProperties } from '../_virtual/_rollupPluginBabelHelpers.js';
import { useMultistep } from '../hooks/useMultistep.js';
import { useMultistepStep } from '../hooks/useMultistepStep.js';
var _excluded = ["children"],
_excluded2 = ["render"],
_excluded3 = ["children"];
function Multistep(_ref) {
var children = _ref.children,
props = _objectWithoutProperties(_ref, _excluded);
var _useMultistep = useMultistep(props),
render = _useMultistep.render,
context = _objectWithoutProperties(_useMultistep, _excluded2);
if (typeof children === 'function') {
return render(children(context));
}
return render(children);
}
Multistep.Step = function MultistepStep(_ref2) {
var children = _ref2.children,
props = _objectWithoutProperties(_ref2, _excluded3);
var _useMultistepStep = useMultistepStep(props),
render = _useMultistepStep.render;
return render(children);
};
export { Multistep };