Merge branch 'master' into NativeAnimation

# Conflicts:
#	android/src/main/java/com/horcrux/svg/RenderableShadowNode.java
#	android/src/main/java/com/horcrux/svg/SvgViewShadowNode.java
#	elements/Image.js
#	elements/Rect.js
#	elements/Use.js
#	lib/attributes.js
This commit is contained in:
Mikael Sand
2018-08-19 15:48:40 +03:00
78 changed files with 1444 additions and 919 deletions

View File

@@ -1,13 +1,13 @@
import React from 'react';
import './Path'; // must import Path first, don`t know why. without this will throw an `Super expression must either be null or a function, not undefined`
import createReactNativeComponentClass from '../lib/createReactNativeComponentClass';
import {pathProps, numberProp} from '../lib/props';
import {RectAttributes} from '../lib/attributes';
import extractProps from '../lib/extract/extractProps';
import Shape from './Shape';
import React from "react";
import "./Path"; // must import Path first, don`t know why. without this will throw an `Super expression must either be null or a function, not undefined`
import { requireNativeComponent } from "react-native";
import { pathProps, numberProp } from "../lib/props";
import { RectAttributes } from "../lib/attributes";
import extractProps from "../lib/extract/extractProps";
import Shape from "./Shape";
export default class extends Shape {
static displayName = 'Rect';
static displayName = "Rect";
static propTypes = {
...pathProps,
@@ -35,24 +35,30 @@ export default class extends Shape {
render() {
let props = this.props;
return <RNSVGRect
ref={ele => {this.root = ele;}}
{...extractProps({
...props,
x: null,
y: null
}, this)}
x={props.x.toString()}
y={props.y.toString()}
rectwidth={props.width.toString()}
rectheight={props.height.toString()}
rx={props.rx.toString()}
ry={props.ry.toString()}
/>;
return (
<RNSVGRect
ref={ele => {
this.root = ele;
}}
{...extractProps(
{
...props,
x: null,
y: null
},
this
)}
x={props.x.toString()}
y={props.y.toString()}
rectwidth={props.width.toString()}
rectheight={props.height.toString()}
rx={props.rx.toString()}
ry={props.ry.toString()}
/>
);
}
}
const RNSVGRect = createReactNativeComponentClass('RNSVGRect', () => ({
validAttributes: RectAttributes,
uiViewClassName: 'RNSVGRect'
}));
const RNSVGRect = requireNativeComponent("RNSVGRect", null, {
nativeOnly: RectAttributes
});