UNPKG

react-native-svg

Version:
2 lines 2.29 kB
import _extends from"@babel/runtime/helpers/extends";import _defineProperty from"@babel/runtime/helpers/defineProperty";import _classCallCheck from"@babel/runtime/helpers/classCallCheck";import _createClass from"@babel/runtime/helpers/createClass";import _possibleConstructorReturn from"@babel/runtime/helpers/possibleConstructorReturn";import _getPrototypeOf from"@babel/runtime/helpers/getPrototypeOf";import _inherits from"@babel/runtime/helpers/inherits";var _jsxFileName="/Users/jannegylling/IdeaProjects/react-native-svg/src/elements/Rect.tsx";function ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);if(enumerableOnly)symbols=symbols.filter(function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable;});keys.push.apply(keys,symbols);}return keys;}function _objectSpread(target){for(var i=1;i<arguments.length;i++){var source=arguments[i]!=null?arguments[i]:{};if(i%2){ownKeys(source,true).forEach(function(key){_defineProperty(target,key,source[key]);});}else if(Object.getOwnPropertyDescriptors){Object.defineProperties(target,Object.getOwnPropertyDescriptors(source));}else{ownKeys(source).forEach(function(key){Object.defineProperty(target,key,Object.getOwnPropertyDescriptor(source,key));});}}return target;}import React from'react';import{requireNativeComponent}from'react-native';import extractProps,{propsAndStyles}from'../lib/extract/extractProps';import Shape from'./Shape';var Rect=function(_Shape){_inherits(Rect,_Shape);function Rect(){_classCallCheck(this,Rect);return _possibleConstructorReturn(this,_getPrototypeOf(Rect).apply(this,arguments));}_createClass(Rect,[{key:"render",value:function render(){var props=this.props;var x=props.x,y=props.y,width=props.width,height=props.height,rx=props.rx,ry=props.ry;return React.createElement(RNSVGRect,_extends({ref:this.refMethod},extractProps(_objectSpread({},propsAndStyles(props),{x:null,y:null}),this),{x:x,y:y,width:width,height:height,rx:rx,ry:ry,__source:{fileName:_jsxFileName,lineNumber:28}}));}}]);return Rect;}(Shape);Rect.displayName='Rect';Rect.defaultProps={x:0,y:0,width:0,height:0};export{Rect as default};export var RNSVGRect=requireNativeComponent('RNSVGRect'); //# sourceMappingURL=Rect.js.map