Skip to content

Commit 0d4e115

Browse files
committed
Fix ts-expect-errors from not using arrow function
1 parent 967030b commit 0d4e115

File tree

1 file changed

+26
-40
lines changed

1 file changed

+26
-40
lines changed

packages/perseus-editor/src/hint-editor.tsx

Lines changed: 26 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -407,46 +407,32 @@ class CombinedHintsEditor extends React.Component<CombinedHintsEditorProps> {
407407

408408
render(): React.ReactNode {
409409
const {itemId, hints} = this.props;
410-
const hintElems = _.map(
411-
hints,
412-
function (hint, i) {
413-
return (
414-
<CombinedHintEditor
415-
ref={"hintEditor" + i}
416-
key={"hintEditor" + i}
417-
isFirst={i === 0}
418-
isLast={i + 1 === hints.length}
419-
itemId={itemId}
420-
hint={hint}
421-
pos={i}
422-
// @ts-expect-error - TS2683 - 'this' implicitly has type 'any' because it does not have a type annotation.
423-
imageUploader={this.props.imageUploader}
424-
// eslint-disable-next-line react/jsx-no-bind
425-
// @ts-expect-error - TS2683 - 'this' implicitly has type 'any' because it does not have a type annotation. | TS2683 - 'this' implicitly has type 'any' because it does not have a type annotation.
426-
onChange={this.handleHintChange.bind(this, i)}
427-
// eslint-disable-next-line react/jsx-no-bind
428-
// @ts-expect-error - TS2683 - 'this' implicitly has type 'any' because it does not have a type annotation. | TS2683 - 'this' implicitly has type 'any' because it does not have a type annotation.
429-
onRemove={this.handleHintRemove.bind(this, i)}
430-
// eslint-disable-next-line react/jsx-no-bind
431-
// @ts-expect-error - TS2683 - 'this' implicitly has type 'any' because it does not have a type annotation. | TS2683 - 'this' implicitly has type 'any' because it does not have a type annotation.
432-
onMove={this.handleHintMove.bind(this, i)}
433-
// @ts-expect-error - TS2683 - 'this' implicitly has type 'any' because it does not have a type annotation.
434-
deviceType={this.props.deviceType}
435-
// @ts-expect-error - TS2683 - 'this' implicitly has type 'any' because it does not have a type annotation.
436-
apiOptions={this.props.apiOptions}
437-
// @ts-expect-error - TS2683 - 'this' implicitly has type 'any' because it does not have a type annotation.
438-
highlightLint={this.props.highlightLint}
439-
// @ts-expect-error - TS2683 - 'this' implicitly has type 'any' because it does not have a type annotation.
440-
previewURL={this.props.previewURL}
441-
// TODO(CP-4838): what should be passed here?
442-
contentPaths={[]}
443-
// @ts-expect-error - TS2683 - 'this' implicitly has type 'any' because it does not have a type annotation.
444-
widgetIsOpen={this.props.widgetIsOpen}
445-
/>
446-
);
447-
},
448-
this,
449-
);
410+
const hintElems = hints.map((hint, i) => {
411+
return (
412+
<CombinedHintEditor
413+
ref={"hintEditor" + i}
414+
key={"hintEditor" + i}
415+
isFirst={i === 0}
416+
isLast={i + 1 === hints.length}
417+
itemId={itemId}
418+
hint={hint}
419+
pos={i}
420+
imageUploader={this.props.imageUploader}
421+
onChange={this.handleHintChange.bind(this, i) as any}
422+
// eslint-disable-next-line react/jsx-no-bind
423+
onRemove={this.handleHintRemove.bind(this, i)}
424+
// eslint-disable-next-line react/jsx-no-bind
425+
onMove={this.handleHintMove.bind(this, i)}
426+
deviceType={this.props.deviceType}
427+
apiOptions={this.props.apiOptions}
428+
highlightLint={this.props.highlightLint}
429+
previewURL={this.props.previewURL}
430+
// TODO(CP-4838): what should be passed here?
431+
contentPaths={[]}
432+
widgetIsOpen={this.props.widgetIsOpen}
433+
/>
434+
);
435+
});
450436

451437
return (
452438
<div className="perseus-hints-editor perseus-editor-table">

0 commit comments

Comments
 (0)