Skip to content

Commit

Permalink
feat: add scrollViewProps optional props
Browse files Browse the repository at this point in the history
  • Loading branch information
jeongshin committed Aug 9, 2023
1 parent 91b1b45 commit 8629fed
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/lib/CodeHighlighter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
type TextStyle,
type StyleProp,
StyleSheet,
type ScrollViewProps,
} from "react-native";
import SyntaxHighlighter, {
type SyntaxHighlighterProps,
Expand All @@ -22,13 +23,15 @@ export interface CodeHighlighterProps extends SyntaxHighlighterProps {
hljsStyle: ReactStyle;
containerStyle?: StyleProp<ViewStyle>;
textStyle?: StyleProp<TextStyle>;
scrollViewProps?: ScrollViewProps;
}

export const CodeHighlighter: FunctionComponent<CodeHighlighterProps> = ({
children,
containerStyle,
textStyle,
hljsStyle,
scrollViewProps,
...rest
}) => {
const stylesheet: HighlighterStyleSheet = useMemo(
Expand Down Expand Up @@ -70,6 +73,7 @@ export const CodeHighlighter: FunctionComponent<CodeHighlighterProps> = ({
const { rows } = props;
return (
<ScrollView
{...scrollViewProps}
horizontal
contentContainerStyle={[stylesheet.hljs, containerStyle]}
>
Expand Down

0 comments on commit 8629fed

Please sign in to comment.