Skip to content

Commit 465341a

Browse files
committed
chore: remove defaultProps to address warning
1 parent 69a9d3c commit 465341a

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

src/codeEditor/index.tsx

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,16 @@ const CodeEditor: React.FC<{
1616
lang?: string;
1717
options?: ICodeMirror['options'];
1818
theme?: 'material-palenight' | 'neo' | 'tomorrow-night';
19-
}> = ({ code, lang, options, children, theme, ...attr }) => {
19+
}> = ({
20+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
21+
className = '', // unused, I think on purpose? but not sure
22+
code = '',
23+
lang,
24+
options = {},
25+
children,
26+
theme = 'material-palenight',
27+
...attr
28+
}) => {
2029
const [value, setValue] = useState(children && typeof children === 'string' ? children : code);
2130
const [mode, setMode] = useState(getMode(lang as string));
2231

@@ -44,11 +53,4 @@ const CodeEditor: React.FC<{
4453
);
4554
};
4655

47-
CodeEditor.defaultProps = {
48-
className: '',
49-
code: '',
50-
options: {},
51-
theme: 'material-palenight',
52-
};
53-
5456
export default CodeEditor;

0 commit comments

Comments
 (0)