-
Notifications
You must be signed in to change notification settings - Fork 977
[OPIK-2366] refactor reason field logic #3200
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -6,16 +6,14 @@ type UseDebouncedValueArgs = { | |||||
onDebouncedChange: (value: string) => void; | ||||||
delay?: number; | ||||||
onChange?: () => void; | ||||||
setInputValue?: (value: string) => void; | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The
Suggested change
Copilot uses AI. Check for mistakes. Positive FeedbackNegative Feedback |
||||||
}; | ||||||
export const useDebouncedValue = ({ | ||||||
initialValue, | ||||||
onDebouncedChange, | ||||||
delay = 300, | ||||||
onChange, | ||||||
}: UseDebouncedValueArgs) => { | ||||||
Comment on lines
10
to
14
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The Copilot uses AI. Check for mistakes. Positive FeedbackNegative Feedback |
||||||
const [inputValue, setInputValue] = useState<string | undefined>( | ||||||
initialValue, | ||||||
); | ||||||
const [inputValue, setInputValue] = useState<string | undefined>(); | ||||||
|
||||||
const debouncedCallback = useMemo( | ||||||
() => debounce(onDebouncedChange, delay), | ||||||
|
@@ -44,6 +42,7 @@ export const useDebouncedValue = ({ | |||||
return { | ||||||
resetValue, | ||||||
value: inputValue, | ||||||
setInputValue, | ||||||
onChange: handleInputChange, | ||||||
onReset, | ||||||
}; | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
initialValue
parameter is being passed but was removed from theuseDebouncedValue
hook parameters. This will be ignored and could lead to unexpected behavior.Copilot uses AI. Check for mistakes.