Migration of jsx files to tsx 2 (#850)

This is to continue the work of migrating all the jsx files into tsx
files.
The MO is basically described here: #848.

About 7 files to go...
This commit is contained in:
Harel M
2023-12-22 23:32:25 +02:00
committed by GitHub
parent fa182e66fa
commit 974dd7bfd9
57 changed files with 827 additions and 827 deletions

View File

@@ -17,7 +17,7 @@ export type InputJsonProps = {
onChange?(...args: unknown[]): unknown
lineNumbers?: boolean
lineWrapping?: boolean
getValue(data: any): string
getValue?(data: any): string
gutters?: string[]
className?: string
onFocus?(...args: unknown[]): unknown
@@ -58,13 +58,13 @@ export default class InputJson extends React.Component<InputJsonProps, InputJson
this.state = {
isEditing: false,
showMessage: false,
prevValue: this.props.getValue(this.props.layer),
prevValue: this.props.getValue!(this.props.layer),
};
}
componentDidMount () {
this._doc = CodeMirror(this._el!, {
value: this.props.getValue(this.props.layer),
value: this.props.getValue!(this.props.layer),
mode: this.props.mode || {
name: "mgl",
},
@@ -117,7 +117,7 @@ export default class InputJson extends React.Component<InputJsonProps, InputJson
if (!this.state.isEditing && prevProps.layer !== this.props.layer) {
this._cancelNextChange = true;
this._doc!.setValue(
this.props.getValue(this.props.layer),
this.props.getValue!(this.props.layer),
)
}
}