Remove internal imports. Run prettier.

This commit is contained in:
Mikael Sand
2018-03-19 04:02:14 +02:00
parent 461d176d20
commit 4e6ba9a786
24 changed files with 510 additions and 422 deletions
+30 -21
View File
@@ -1,14 +1,14 @@
import React from 'react';
import PropTypes from 'prop-types';
import createReactNativeComponentClass from '../lib/createReactNativeComponentClass';
import extractProps from '../lib/extract/extractProps';
import {pathProps, numberProp} from '../lib/props';
import {UseAttributes} from '../lib/attributes';
import Shape from './Shape';
import React from "react";
import PropTypes from "prop-types";
import { requireNativeComponent } from "react-native";
import extractProps from "../lib/extract/extractProps";
import { pathProps, numberProp } from "../lib/props";
import { UseAttributes } from "../lib/attributes";
import Shape from "./Shape";
const idExpReg = /^#(.+)$/;
export default class extends Shape {
static displayName = 'Use';
static displayName = "Use";
static propTypes = {
href: PropTypes.string.isRequired,
@@ -22,7 +22,7 @@ export default class extends Shape {
};
render() {
const {props} = this;
const { props } = this;
// match "url(#pattern)"
const matched = props.href.match(idExpReg);
let href;
@@ -32,20 +32,29 @@ export default class extends Shape {
}
if (!href) {
console.warn('Invalid `href` prop for `Use` element, expected a href like `"#id"`, but got: "' + props.href + '"');
console.warn(
'Invalid `href` prop for `Use` element, expected a href like `"#id"`, but got: "' +
props.href +
'"'
);
}
return <RNSVGUse
ref={ele => {this.root = ele;}}
{...extractProps(props, this)}
href={href}
width={props.width}
height={props.height}
>{props.children}</RNSVGUse>;
return (
<RNSVGUse
ref={ele => {
this.root = ele;
}}
{...extractProps(props, this)}
href={href}
width={props.width}
height={props.height}
>
{props.children}
</RNSVGUse>
);
}
}
const RNSVGUse = createReactNativeComponentClass('RNSVGUse', () => ({
validAttributes: UseAttributes,
uiViewClassName: 'RNSVGUse'
}));
const RNSVGUse = requireNativeComponent("RNSVGUse", null, {
nativeOnly: UseAttributes
});