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

useReducer #68

Open
moody2times opened this issue Apr 28, 2022 · 0 comments
Open

useReducer #68

moody2times opened this issue Apr 28, 2022 · 0 comments
Assignees
Labels
enhancement New feature or request task A to do item

Comments

@moody2times
Copy link
Contributor

moody2times commented Apr 28, 2022

Replace useState

Currently, we are using useState hook to manage the user selection state based on the radio button clicked. The currently logic is using some hard coded values like beginner etc. It will be better to use the useReducer hook to handle the logic because the state is complex. Another advantage of the useReducer hook is that we can dispatch a payload that can be used to replace the hard coded values in the searchForm component.

@moody2times moody2times added enhancement New feature or request task A to do item labels Apr 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request task A to do item
Projects
None yet
Development

No branches or pull requests

2 participants