@magnetman103/react-native-zoom-toolkit
Version:
Most complete set of pinch to zoom utilites for React Native
19 lines (18 loc) • 695 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = withSnapbackValidation;
var _react = _interopRequireDefault(require("react"));
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
function withSnapbackValidation(Component) {
return props => {
const childrenCount = _react.default.Children.count(props.children);
if (childrenCount !== 1) {
const message = `SnapbackZoom expected one child but received ${childrenCount} children`;
throw new Error(message);
}
return /*#__PURE__*/_react.default.createElement(Component, props);
};
}
//# sourceMappingURL=withSnapbackValidation.js.map