Skip to content

Commit 9fc0c87

Browse files
authored
Merge pull request #90 from jeongshin/main
feat: add scrollViewProps optional props
2 parents d0d5e68 + 8629fed commit 9fc0c87

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/lib/CodeHighlighter.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import {
77
type TextStyle,
88
type StyleProp,
99
StyleSheet,
10+
type ScrollViewProps,
1011
} from "react-native";
1112
import SyntaxHighlighter, {
1213
type SyntaxHighlighterProps,
@@ -22,13 +23,15 @@ export interface CodeHighlighterProps extends SyntaxHighlighterProps {
2223
hljsStyle: ReactStyle;
2324
containerStyle?: StyleProp<ViewStyle>;
2425
textStyle?: StyleProp<TextStyle>;
26+
scrollViewProps?: ScrollViewProps;
2527
}
2628

2729
export const CodeHighlighter: FunctionComponent<CodeHighlighterProps> = ({
2830
children,
2931
containerStyle,
3032
textStyle,
3133
hljsStyle,
34+
scrollViewProps,
3235
...rest
3336
}) => {
3437
const stylesheet: HighlighterStyleSheet = useMemo(
@@ -70,6 +73,7 @@ export const CodeHighlighter: FunctionComponent<CodeHighlighterProps> = ({
7073
const { rows } = props;
7174
return (
7275
<ScrollView
76+
{...scrollViewProps}
7377
horizontal
7478
contentContainerStyle={[stylesheet.hljs, containerStyle]}
7579
>

0 commit comments

Comments
 (0)