Skip to content

Commit

Permalink
use optional chaining to assign language
Browse files Browse the repository at this point in the history
  • Loading branch information
jurajk committed Mar 4, 2020
1 parent 15758b3 commit bc5e23d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/styleguide/src/components/MDX/MDX.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export const MDXComponents = {
inlineCode: props => <Code {...props} />,
code: props => (
<CodeBlock
language={props.className && props.className.replace(/language-/, '')}
language={props.className?.replace(/language-/, '')}
{...props}
/>
),
Expand Down

0 comments on commit bc5e23d

Please sign in to comment.