File tree Expand file tree Collapse file tree 1 file changed +1
-3
lines changed
packages/react-code-blocks/src/components/Snippet Expand file tree Collapse file tree 1 file changed +1
-3
lines changed Original file line number Diff line number Diff line change @@ -19,7 +19,6 @@ const SnippetWrapper = styled.div<
1919 style : any ;
2020 }
2121> `
22- {
2322 position: relative;
2423 width: ${ ( { width } ) => width } ;
2524 max-width: 100%;
@@ -29,7 +28,6 @@ const SnippetWrapper = styled.div<
2928 background-color: ${ ( { style } ) => style . bgColor } ;
3029 border: 1px solid ${ ( { style } ) => style . border } ;
3130 border-radius: 5px;
32- }
3331 pre {
3432 margin: 0;
3533 padding: 0;
@@ -97,7 +95,7 @@ const Snippet: React.FC<React.PropsWithChildren<SnippetProps>> = ({
9795 const ref = useRef < HTMLPreElement > ( null ) ;
9896 const isMultiLine = text && Array . isArray ( text ) ;
9997 const theme = useContext ( ThemeContext ) ;
100- const style = useMemo ( ( ) => getStyles ( theme ) , [ theme ] ) ;
98+ const style = useMemo ( ( ) => ! ! theme && getStyles ( theme ) , [ theme ] ) ;
10199 const showCopyIcon = useMemo ( ( ) => copyType !== 'prevent' , [ copyType ] ) ;
102100 const childText = useMemo < string | undefined | null > ( ( ) => {
103101 if ( isMultiLine ) return textArrayToString ( text as string [ ] ) ;
You can’t perform that action at this time.
0 commit comments