mirror of
https://github.com/zoriya/react-native-svg.git
synced 2026-06-02 14:50:43 +00:00
refactor: refine types
This commit is contained in:
Vendored
+1
-1
@@ -426,7 +426,7 @@ export const Mask: React.ComponentClass<MaskProps>;
|
|||||||
|
|
||||||
export interface AST {
|
export interface AST {
|
||||||
tag: string;
|
tag: string;
|
||||||
children: (AST | string)[] | (React.ReactElement | string)[];
|
children: (AST | string)[] | (JSX.Element | string)[];
|
||||||
props: {};
|
props: {};
|
||||||
Tag: React.ComponentType;
|
Tag: React.ComponentType;
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-3
@@ -3,7 +3,6 @@ import React, {
|
|||||||
useState,
|
useState,
|
||||||
useEffect,
|
useEffect,
|
||||||
useMemo,
|
useMemo,
|
||||||
ReactElement,
|
|
||||||
ComponentType,
|
ComponentType,
|
||||||
} from 'react';
|
} from 'react';
|
||||||
import Rect from './elements/Rect';
|
import Rect from './elements/Rect';
|
||||||
@@ -60,7 +59,7 @@ function missingTag() {
|
|||||||
|
|
||||||
export interface AST {
|
export interface AST {
|
||||||
tag: string;
|
tag: string;
|
||||||
children: (AST | string)[] | (ReactElement | string)[];
|
children: (AST | string)[] | (JSX.Element | string)[];
|
||||||
props: {};
|
props: {};
|
||||||
Tag: ComponentType;
|
Tag: ComponentType;
|
||||||
}
|
}
|
||||||
@@ -195,7 +194,7 @@ export function getStyle(string: string): Styles {
|
|||||||
export function astToReact(
|
export function astToReact(
|
||||||
value: AST | string,
|
value: AST | string,
|
||||||
index: number,
|
index: number,
|
||||||
): ReactElement | string {
|
): JSX.Element | string {
|
||||||
if (typeof value === 'object') {
|
if (typeof value === 'object') {
|
||||||
const { Tag, props, children } = value;
|
const { Tag, props, children } = value;
|
||||||
return (
|
return (
|
||||||
|
|||||||
Reference in New Issue
Block a user