Skip to content

Commit 0700486

Browse files
authored
Replaced 'lineNumberProps' with 'lineNumberStyle' (#1150)
* Replaced 'lineNumberProps' with 'lineNumberStyle' * No need to spread
1 parent c9863f0 commit 0700486

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

packages/spectacle/src/components/code-pane.tsx

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -112,13 +112,11 @@ const CodePane = forwardRef<HTMLDivElement, CodePaneProps>(
112112

113113
const scrollTarget = useRef<HTMLElement>(null);
114114

115-
const getLineNumberProps = useCallback(
115+
const getLineNumberStyle = useCallback(
116116
(lineNumber: number) => {
117-
if (!isActive) return;
117+
if (!isActive) return {};
118118
const range = getRangeFormat(numberOfSteps, highlightRanges, step);
119-
return {
120-
style: getStyleForLineNumber(lineNumber, range)
121-
};
119+
return getStyleForLineNumber(lineNumber, range);
122120
},
123121
[isActive, highlightRanges, numberOfSteps, step]
124122
);
@@ -174,7 +172,7 @@ const CodePane = forwardRef<HTMLDivElement, CodePaneProps>(
174172
wrapLines
175173
showLineNumbers={showLineNumbers}
176174
lineProps={getLineProps}
177-
lineNumberProps={getLineNumberProps}
175+
lineNumberStyle={getLineNumberStyle}
178176
style={syntaxTheme}
179177
>
180178
{children}

0 commit comments

Comments
 (0)