From c8813dc834e7e7e88bcfe9bbdfd3d246a8f916aa Mon Sep 17 00:00:00 2001 From: ruben-rebelo Date: Tue, 9 Jan 2024 10:23:10 +0000 Subject: [PATCH] [TS migration] Code style improvements --- src/components/HTMLEngineProvider/htmlEngineUtils.ts | 2 +- src/components/HTMLEngineProvider/index.native.tsx | 8 +------- src/components/HTMLEngineProvider/index.tsx | 8 +------- src/components/HTMLEngineProvider/types.ts | 2 +- 4 files changed, 4 insertions(+), 16 deletions(-) diff --git a/src/components/HTMLEngineProvider/htmlEngineUtils.ts b/src/components/HTMLEngineProvider/htmlEngineUtils.ts index 8ceb38d1c87c..8d188017e91e 100644 --- a/src/components/HTMLEngineProvider/htmlEngineUtils.ts +++ b/src/components/HTMLEngineProvider/htmlEngineUtils.ts @@ -47,7 +47,7 @@ function isChildOfNode(tnode: TNode, predicate: Predicate): boolean { * Finding node with name 'comment' flags that we are rendering a comment. */ function isChildOfComment(tnode: TNode): boolean { - return isChildOfNode(tnode, (node) => node.domNode?.name !== undefined && isCommentTag(node.domNode?.name)) ; + return isChildOfNode(tnode, (node) => node.domNode?.name !== undefined && isCommentTag(node.domNode?.name)); } /** diff --git a/src/components/HTMLEngineProvider/index.native.tsx b/src/components/HTMLEngineProvider/index.native.tsx index f3decaf874fa..bff138ced481 100755 --- a/src/components/HTMLEngineProvider/index.native.tsx +++ b/src/components/HTMLEngineProvider/index.native.tsx @@ -3,13 +3,7 @@ import BaseHTMLEngineProvider from './BaseHTMLEngineProvider'; import type {HTMLEngineProviderProps} from './types'; function HTMLEngineProvider({children}: HTMLEngineProviderProps) { - return ( - - {children} - - ); + return {children}; } HTMLEngineProvider.displayName = 'HTMLEngineProvider'; diff --git a/src/components/HTMLEngineProvider/index.tsx b/src/components/HTMLEngineProvider/index.tsx index 0cd7449616ca..c178c9feea96 100755 --- a/src/components/HTMLEngineProvider/index.tsx +++ b/src/components/HTMLEngineProvider/index.tsx @@ -7,13 +7,7 @@ import type {HTMLEngineProviderProps} from './types'; function HTMLEngineProvider({children = null}: HTMLEngineProviderProps) { const {isSmallScreenWidth} = useWindowDimensions(); - return ( - - {children} - - ); + return {children}; } HTMLEngineProvider.displayName = 'HTMLEngineProvider'; diff --git a/src/components/HTMLEngineProvider/types.ts b/src/components/HTMLEngineProvider/types.ts index 2c9624d6b4d1..6b8ee50b46d0 100644 --- a/src/components/HTMLEngineProvider/types.ts +++ b/src/components/HTMLEngineProvider/types.ts @@ -1,7 +1,7 @@ import type {TNode} from 'react-native-render-html'; import type ChildrenProps from '@src/types/utils/ChildrenProps'; -type HTMLEngineProviderProps = ChildrenProps +type HTMLEngineProviderProps = ChildrenProps; type Predicate = (node: TNode) => boolean;