From 2fb2a4997032f0fadc0030f9f76e00aaae8d9b90 Mon Sep 17 00:00:00 2001 From: Wildan Muhlis Date: Mon, 29 Apr 2024 13:15:45 +0700 Subject: [PATCH] Add comment to getCurrentData --- src/components/InlineCodeBlock/index.native.tsx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/components/InlineCodeBlock/index.native.tsx b/src/components/InlineCodeBlock/index.native.tsx index 5dbf80045012..048bcfc960bd 100644 --- a/src/components/InlineCodeBlock/index.native.tsx +++ b/src/components/InlineCodeBlock/index.native.tsx @@ -1,10 +1,18 @@ import React from 'react'; -import useThemeStyles from '@hooks/useThemeStyles'; import type {TDefaultRendererProps} from 'react-native-render-html'; +import useThemeStyles from '@hooks/useThemeStyles'; import type InlineCodeBlockProps from './types'; import type {TTextOrTPhrasing} from './types'; import WrappedText from './WrappedText'; +/** + * Retrieves the text content from a Text or Phrasing node. + * + * @param defaultRendererProps - The default renderer props containing the node information. + * @returns The text content of the node. + * + * @template TTextOrTPhrasing + */ function getCurrentData(defaultRendererProps: TDefaultRendererProps): string { if ('data' in defaultRendererProps.tnode) { return defaultRendererProps.tnode.data;