mirror of
https://github.com/zoriya/react-native-svg.git
synced 2026-05-31 05:51:47 +00:00
Extend and improve propTypes. Optimize javascript hidden classes and inline caching in V8.
Add lengthAdjust and textLength text / tspan attributes.
This commit is contained in:
+2
-7
@@ -2,7 +2,7 @@ import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import createReactNativeComponentClass from 'react-native/Libraries/Renderer/shims/createReactNativeComponentClass';
|
||||
import extractText from '../lib/extract/extractText';
|
||||
import {pathProps, fontProps} from '../lib/props';
|
||||
import {textProps} from '../lib/props';
|
||||
import {TSpanAttibutes} from '../lib/attributes';
|
||||
import extractProps from '../lib/extract/extractProps';
|
||||
import Shape from './Shape';
|
||||
@@ -11,12 +11,7 @@ import Shape from './Shape';
|
||||
export default class extends Shape {
|
||||
static displayName = 'TSpan';
|
||||
|
||||
static propTypes = {
|
||||
...pathProps,
|
||||
...fontProps,
|
||||
dx: PropTypes.string,
|
||||
dy: PropTypes.string,
|
||||
};
|
||||
static propTypes = textProps;
|
||||
|
||||
//noinspection JSUnusedGlobalSymbols
|
||||
static childContextTypes = {
|
||||
|
||||
+2
-7
@@ -2,7 +2,7 @@ import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import createReactNativeComponentClass from 'react-native/Libraries/Renderer/shims/createReactNativeComponentClass';
|
||||
import extractText from '../lib/extract/extractText';
|
||||
import {pathProps, fontProps} from '../lib/props';
|
||||
import {textProps} from '../lib/props';
|
||||
import {TextAttributes} from '../lib/attributes';
|
||||
import extractProps from '../lib/extract/extractProps';
|
||||
import Shape from './Shape';
|
||||
@@ -10,12 +10,7 @@ import Shape from './Shape';
|
||||
export default class extends Shape {
|
||||
static displayName = 'Text';
|
||||
|
||||
static propTypes = {
|
||||
...pathProps,
|
||||
...fontProps,
|
||||
dx: PropTypes.string,
|
||||
dy: PropTypes.string,
|
||||
};
|
||||
static propTypes = textProps;
|
||||
|
||||
//noinspection JSUnusedGlobalSymbols
|
||||
static childContextTypes = {
|
||||
|
||||
@@ -4,7 +4,7 @@ import createReactNativeComponentClass from 'react-native/Libraries/Renderer/shi
|
||||
import {TextPathAttributes} from '../lib/attributes';
|
||||
import extractText from '../lib/extract/extractText';
|
||||
import Shape from './Shape';
|
||||
import {pathProps, fontProps} from '../lib/props';
|
||||
import {textPathProps} from '../lib/props';
|
||||
import extractProps from '../lib/extract/extractProps';
|
||||
import TSpan from './TSpan';
|
||||
|
||||
@@ -13,14 +13,7 @@ const idExpReg = /^#(.+)$/;
|
||||
export default class extends Shape {
|
||||
static displayName = 'Span';
|
||||
|
||||
static propTypes = {
|
||||
...pathProps,
|
||||
...fontProps,
|
||||
href: PropTypes.string.isRequired,
|
||||
method: PropTypes.oneOf(['align', 'stretch']),
|
||||
spacing: PropTypes.oneOf(['auto', 'exact']),
|
||||
startOffset: PropTypes.string
|
||||
};
|
||||
static propTypes = textPathProps;
|
||||
|
||||
render() {
|
||||
let {children, href, startOffset, ...props} = this.props;
|
||||
|
||||
Reference in New Issue
Block a user