Skip to content

Commit

Permalink
Add comment to getCurrentData
Browse files Browse the repository at this point in the history
  • Loading branch information
wildan-m committed Apr 29, 2024
1 parent 4e651a8 commit 2fb2a49
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/components/InlineCodeBlock/index.native.tsx
Original file line number Diff line number Diff line change
@@ -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<TTextOrTPhrasing>): string {
if ('data' in defaultRendererProps.tnode) {
return defaultRendererProps.tnode.data;
Expand Down

0 comments on commit 2fb2a49

Please sign in to comment.