Skip to content

Commit

Permalink
[TS migration] Code style improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
ruben-rebelo committed Jan 9, 2024
1 parent 5b9473f commit c8813dc
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 16 deletions.
2 changes: 1 addition & 1 deletion src/components/HTMLEngineProvider/htmlEngineUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}

/**
Expand Down
8 changes: 1 addition & 7 deletions src/components/HTMLEngineProvider/index.native.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,7 @@ import BaseHTMLEngineProvider from './BaseHTMLEngineProvider';
import type {HTMLEngineProviderProps} from './types';

function HTMLEngineProvider({children}: HTMLEngineProviderProps) {
return (
<BaseHTMLEngineProvider
enableExperimentalBRCollapsing
>
{children}
</BaseHTMLEngineProvider>
);
return <BaseHTMLEngineProvider enableExperimentalBRCollapsing>{children}</BaseHTMLEngineProvider>;
}

HTMLEngineProvider.displayName = 'HTMLEngineProvider';
Expand Down
8 changes: 1 addition & 7 deletions src/components/HTMLEngineProvider/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,7 @@ import type {HTMLEngineProviderProps} from './types';
function HTMLEngineProvider({children = null}: HTMLEngineProviderProps) {
const {isSmallScreenWidth} = useWindowDimensions();

return (
<BaseHTMLEngineProvider
textSelectable={!DeviceCapabilities.canUseTouchScreen() || !isSmallScreenWidth}
>
{children}
</BaseHTMLEngineProvider>
);
return <BaseHTMLEngineProvider textSelectable={!DeviceCapabilities.canUseTouchScreen() || !isSmallScreenWidth}>{children}</BaseHTMLEngineProvider>;
}

HTMLEngineProvider.displayName = 'HTMLEngineProvider';
Expand Down
2 changes: 1 addition & 1 deletion src/components/HTMLEngineProvider/types.ts
Original file line number Diff line number Diff line change
@@ -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;

Expand Down

0 comments on commit c8813dc

Please sign in to comment.