From f5912066a56d3ebed8a5ec0cd96e8bedc46d792f Mon Sep 17 00:00:00 2001 From: zoomchan-cxj Date: Wed, 13 Jan 2021 18:08:47 +0800 Subject: [PATCH] feat(hippy-react): added Text displayName --- packages/hippy-react/src/components/text.tsx | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/packages/hippy-react/src/components/text.tsx b/packages/hippy-react/src/components/text.tsx index 9f22014ca..320120648 100644 --- a/packages/hippy-react/src/components/text.tsx +++ b/packages/hippy-react/src/components/text.tsx @@ -49,7 +49,11 @@ interface TextProps extends LayoutableProps, ClickableProps { * `Text` doesn't support nesting. * @noInheritDoc */ -const Text = React.forwardRef(({ style, ...nativeProps }: TextProps, ref) => { +function forwardRef( + { style, ...nativeProps }: TextProps, + // eslint-disable-next-line max-len + ref: string | ((instance: HTMLParagraphElement | null) => void) | React.RefObject | null | undefined, +) { const nativeStyle: undefined | Style | Style[] = style; // Fill default color @@ -83,9 +87,11 @@ const Text = React.forwardRef(({ style, ...nativeProps }: TextProps, ref) => { } return ( - // @ts-ignore + // @ts-ignore

); -}); - +} +forwardRef.displayName = 'Text'; +const Text = React.forwardRef(forwardRef); +Text.displayName = 'Text'; export default Text;