mirror of
https://github.com/zoriya/react-native-svg.git
synced 2026-05-27 20:45:10 +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 {
|
||||
tag: string;
|
||||
children: (AST | string)[] | (React.ReactElement | string)[];
|
||||
children: (AST | string)[] | (JSX.Element | string)[];
|
||||
props: {};
|
||||
Tag: React.ComponentType;
|
||||
}
|
||||
|
||||
+2
-3
@@ -3,7 +3,6 @@ import React, {
|
||||
useState,
|
||||
useEffect,
|
||||
useMemo,
|
||||
ReactElement,
|
||||
ComponentType,
|
||||
} from 'react';
|
||||
import Rect from './elements/Rect';
|
||||
@@ -60,7 +59,7 @@ function missingTag() {
|
||||
|
||||
export interface AST {
|
||||
tag: string;
|
||||
children: (AST | string)[] | (ReactElement | string)[];
|
||||
children: (AST | string)[] | (JSX.Element | string)[];
|
||||
props: {};
|
||||
Tag: ComponentType;
|
||||
}
|
||||
@@ -195,7 +194,7 @@ export function getStyle(string: string): Styles {
|
||||
export function astToReact(
|
||||
value: AST | string,
|
||||
index: number,
|
||||
): ReactElement | string {
|
||||
): JSX.Element | string {
|
||||
if (typeof value === 'object') {
|
||||
const { Tag, props, children } = value;
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user