diff --git a/packages/insomnia/src/ui/components/editors/request-headers-editor.tsx b/packages/insomnia/src/ui/components/editors/request-headers-editor.tsx index 2eaf81769320..27524021bb30 100644 --- a/packages/insomnia/src/ui/components/editors/request-headers-editor.tsx +++ b/packages/insomnia/src/ui/components/editors/request-headers-editor.tsx @@ -78,8 +78,6 @@ export const RequestHeadersEditor: FC = ({ headersString += `${header.name}: ${header.value}\n`; } - const handleChange = useCallback((headers: RequestHeader[]) => patcher(id, { headers }), [id, patcher]); - if (bulk) { return (
@@ -101,7 +99,7 @@ export const RequestHeadersEditor: FC = ({ pairs={headers} handleGetAutocompleteNameConstants={getCommonHeaderNames} handleGetAutocompleteValueConstants={getCommonHeaderValues} - onChange={handleChange} + onChange={headers => patcher(id, { headers })} isDisabled={isDisabled} readOnlyPairs={isWebSocketRequest ? readOnlyWebsocketPairs : readOnlyHttpPairs} /> diff --git a/packages/insomnia/src/ui/components/panes/grpc-request-pane.tsx b/packages/insomnia/src/ui/components/panes/grpc-request-pane.tsx index 696c9b29cb4e..16902818e434 100644 --- a/packages/insomnia/src/ui/components/panes/grpc-request-pane.tsx +++ b/packages/insomnia/src/ui/components/panes/grpc-request-pane.tsx @@ -1,4 +1,4 @@ -import React, { FunctionComponent, useCallback, useRef, useState } from 'react'; +import React, { FunctionComponent, useRef, useState } from 'react'; import { useParams, useRouteLoaderData } from 'react-router-dom'; import { useMount } from 'react-use'; import styled from 'styled-components'; @@ -144,8 +144,6 @@ export const GrpcRequestPane: FunctionComponent = ({ request_send: handleRequestSend, }); - const handleHeadersChange = useCallback((metadata: GrpcRequestHeader[]) => patchRequest(requestId, { metadata }), [patchRequest, requestId]); - return ( <> @@ -320,7 +318,7 @@ export const GrpcRequestPane: FunctionComponent = ({ isDisabled={running} handleGetAutocompleteNameConstants={getCommonHeaderNames} handleGetAutocompleteValueConstants={getCommonHeaderValues} - onChange={handleHeadersChange} + onChange={(metadata: GrpcRequestHeader[]) => patchRequest(requestId, { metadata })} />