1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-17 07:41:26 +00:00

remove react old defaultProps (#7576)

This commit is contained in:
Michael An
2025-03-10 14:27:08 +08:00
committed by GitHub
parent 00707d1d05
commit 55719ccbdf
43 changed files with 214 additions and 438 deletions

View File

@@ -19,16 +19,12 @@ const propTypes = {
class SeafileCodeMirror extends React.Component {
static defaultProps = {
readOnly: true,
};
onChange = (value) => {
this.props.onChange && this.props.onChange(value);
};
render() {
const { value, readOnly, fileExt } = this.props;
const { value, readOnly = true, fileExt } = this.props;
const extensions = [...getLanguageExtensions(fileExt).filter(item => item !== null)];
return (
<div className='seafile-code-mirror-container'>