Skip to content

Commit 3ddcad3

Browse files
committed
slight cleanup
1 parent dc51765 commit 3ddcad3

File tree

1 file changed

+4
-11
lines changed

1 file changed

+4
-11
lines changed

src/index.tsx

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ export interface IDoc extends codemirror.Doc {
4141
export interface IInstance extends codemirror.Editor, IDoc {
4242
options: codemirror.EditorConfiguration
4343
}
44-
4544
/* </tshacks> */
4645

4746
export interface ICodeMirror {
@@ -559,9 +558,7 @@ export class Controlled extends React.Component<IControlledCodeMirror, any> {
559558

560559
let className = this.props.className ? `react-codemirror2 ${this.props.className}` : 'react-codemirror2';
561560

562-
return (
563-
<div className={className} ref={(self) => this.ref = self}/>
564-
)
561+
return <div className={className} ref={self => this.ref = self}/>
565562
}
566563
}
567564

@@ -723,22 +720,20 @@ export class UnControlled extends React.Component<IUnControlledCodeMirror, any>
723720
/** @internal */
724721
public componentWillReceiveProps(nextProps) {
725722

726-
if(this.detached && (nextProps.detach === false)) {
723+
if (this.detached && (nextProps.detach === false)) {
727724
this.detached = false;
728725
if (this.props.editorDidAttach) {
729726
this.props.editorDidAttach(this.editor);
730727
}
731728
}
732729

733-
if(!this.detached && (nextProps.detach === true)) {
730+
if (!this.detached && (nextProps.detach === true)) {
734731
this.detached = true;
735732
if (this.props.editorDidDetach) {
736733
this.props.editorDidDetach(this.editor);
737734
}
738735
}
739736

740-
741-
742737
if (SERVER_RENDERED || this.detached) return;
743738

744739
let preserved: IPreservedOptions = {cursor: null};
@@ -794,8 +789,6 @@ export class UnControlled extends React.Component<IUnControlledCodeMirror, any>
794789

795790
let className = this.props.className ? `react-codemirror2 ${this.props.className}` : 'react-codemirror2';
796791

797-
return (
798-
<div className={className} ref={(self) => this.ref = self}/>
799-
)
792+
return <div className={className} ref={self => this.ref = self}/>
800793
}
801794
}

0 commit comments

Comments
 (0)