Skip to content
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

[BUG-FIX] search filter for admin tends to rerender complete component #2

Merged
merged 1 commit into from
Feb 17, 2023

Conversation

Dev-Puneet-V
Copy link
Owner

To resolve this bug, the filtered data state should be in AdminProducts component, so when admin tries to search anything it shall not rerender the component which contains the Search component. The problem I was facing is how can we change the filtered data state which is in child component, from the parent component. So here comes the useImperativeHandle react hook which helps us to achieve this.

@Dev-Puneet-V Dev-Puneet-V self-assigned this Feb 17, 2023
@Dev-Puneet-V Dev-Puneet-V linked an issue Feb 17, 2023 that may be closed by this pull request
@Dev-Puneet-V Dev-Puneet-V merged commit abf2cca into main Feb 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Product filter is not working for admin
1 participant