From 64371b82d16872ccf27899b8de8daa7850d88aab Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Sat, 25 Feb 2023 16:38:04 -0500 Subject: [PATCH] fix: Use of this inside functional component (bad merge) --- app/components/Input.tsx | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/app/components/Input.tsx b/app/components/Input.tsx index 9d28d3682..83db3344f 100644 --- a/app/components/Input.tsx +++ b/app/components/Input.tsx @@ -122,7 +122,9 @@ export type Props = React.InputHTMLAttributes< error?: string; icon?: React.ReactNode; /* Callback is triggered with the CMD+Enter keyboard combo */ - onRequestSubmit?: (ev: React.KeyboardEvent) => unknown; + onRequestSubmit?: ( + ev: React.KeyboardEvent + ) => unknown; onFocus?: (ev: React.SyntheticEvent) => unknown; onBlur?: (ev: React.SyntheticEvent) => unknown; }; @@ -153,13 +155,13 @@ function Input( ev: React.KeyboardEvent ) => { if (ev.key === "Enter" && ev.metaKey) { - if (this.props.onRequestSubmit) { - this.props.onRequestSubmit(ev); + if (props.onRequestSubmit) { + props.onRequestSubmit(ev); } } - if (this.props.onKeyDown) { - this.props.onKeyDown(ev); + if (props.onKeyDown) { + props.onKeyDown(ev); } };