diff --git a/src/components/SourceCode/SourceCode.tsx b/src/components/SourceCode/SourceCode.tsx index 12a580db..9a6e352f 100644 --- a/src/components/SourceCode/SourceCode.tsx +++ b/src/components/SourceCode/SourceCode.tsx @@ -9,24 +9,21 @@ export interface SourceCodeProps { lang: string; } -export class SourceCode extends React.PureComponent { - render() { - const { source, lang } = this.props; - return ; - } -} +export const SourceCode = (props: SourceCodeProps) => { + const { source, lang } = props; + return ; +}; -export class SourceCodeWithCopy extends React.Component { - render() { - return ( - - {({ renderCopyButton }) => ( - - {renderCopyButton()} - - - )} - - ); - } -} +export const SourceCodeWithCopy = (props: SourceCodeProps) => { + const { source, lang } = props; + return ( + + {({ renderCopyButton }) => ( + + {renderCopyButton()} + + + )} + + ); +};