Skip to content

Commit e54e0c7

Browse files
committed
Fix ts-expect-errors from not using arrow function
1 parent b62e3cf commit e54e0c7

File tree

1 file changed

+22
-35
lines changed

1 file changed

+22
-35
lines changed

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

Lines changed: 22 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -410,44 +410,31 @@ class CombinedHintsEditor extends React.Component<CombinedHintsEditorProps> {
410410

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

452439
return (
453440
<div className="perseus-hints-editor perseus-editor-table">

0 commit comments

Comments
 (0)