Files
react-native-svg/elements/Line.js
Horcrux 8d01e8eccb refactor shape elements add responder system.
refactor shape elements add responder system.
Just iOS.
2016-05-15 00:40:43 +08:00

36 lines
1006 B
JavaScript

import React, {PropTypes, Component} from 'react';
import extractProps from '../lib/extract/extractProps';
import {RenderableAttributes} from '../lib/attributes';
import {requireNativeComponent} from 'react-native';
import mergeContext from '../lib/mergeContext';
import {lineProps, pathProps, fillProps, strokeProps} from '../lib/props';
class Line extends Component{
static displayName = 'Line';
static propTypes = {
...pathProps,
...lineProps
};
static contextTypes = {
...fillProps,
...strokeProps,
...lineProps,
isInGroup: PropTypes.bool
};
render() {
let props = mergeContext(this.props, this.context);
return <RNSVGLine
{...extractProps(props)}
x1={props.x1.toString()}
y1={props.y1.toString()}
x2={props.x2.toString()}
y2={props.y2.toString()}
/>;
}
}
const RNSVGLine = requireNativeComponent('RNSVGLine', null);
export default Line;