Skip to content

Commit e5e84d1

Browse files
committed
updated the usecallback portion
1 parent 7541947 commit e5e84d1

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

packages/compass-indexes/src/components/create-index-form/query-flow-section.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ const QueryFlowSection = ({
148148
radius: editorContainerRadius,
149149
});
150150

151-
const generateSuggestedIndexes = () => {
151+
const generateSuggestedIndexes = useCallback(() => {
152152
const sanitizedInputQuery = inputQuery.trim();
153153

154154
void onSuggestedIndexButtonClick({
@@ -157,14 +157,14 @@ const QueryFlowSection = ({
157157
inputQuery: sanitizedInputQuery,
158158
});
159159
setHasNewChanges(false);
160-
};
160+
}, [inputQuery, dbName, collectionName, onSuggestedIndexButtonClick]);
161161

162-
const handleSuggestedIndexButtonClick = useCallback(() => {
162+
const handleSuggestedIndexButtonClick = () => {
163163
generateSuggestedIndexes();
164164
track('Suggested Index Button Clicked', {
165165
context: 'Create Index Modal',
166166
});
167-
}, [inputQuery, dbName, collectionName, onSuggestedIndexButtonClick]);
167+
};
168168

169169
const handleQueryInputChange = useCallback((text: string) => {
170170
setInputQuery(text);

0 commit comments

Comments
 (0)