You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The current implementation of the shared SearchBox component relies on parent components to manage the search input field value via the onChange prop. This also includes the responsibility of clearing the input (i.e., resetting it to an empty string).
SearchBox is shared across the following components:
pages/search/index
Compendia/DownloadBlock
Home/HeroBody
SearchResults/SearchFilter
In this PR, we'll shift the responsibility of resetting the input value to SearchBox itself by using local state. This change will simplify the state management of the input value within SearchBox and reduce the dependency on parent components.
Additionally, any event handler props passed from the parent (e.g., onChange, onSubmit) will be converted to no-op functions by default unless explicitly needed.
Solution or next step
Add a new local state to SearchBox for managing the input rest
Set all event handler props to noop by default
Update the parent components accordingly
The text was updated successfully, but these errors were encountered:
Context
The current implementation of the shared
SearchBox
component relies on parent components to manage the search input field value via theonChange
prop. This also includes the responsibility of clearing the input (i.e., resetting it to an empty string).SearchBox
is shared across the following components:pages/search/index
Compendia/DownloadBlock
Home/HeroBody
SearchResults/SearchFilter
In this PR, we'll shift the responsibility of resetting the input value to
SearchBox
itself by using local state. This change will simplify the state management of the input value withinSearchBox
and reduce the dependency on parent components.Additionally, any event handler props passed from the parent (e.g.,
onChange
,onSubmit
) will be converted to no-op functions by default unless explicitly needed.Solution or next step
SearchBox
for managing the input restThe text was updated successfully, but these errors were encountered: