Refactor: Convert native `Dropdown` to functional component
What?
Related #22890
This PR converts the native Dropdown component from a class based implementation to a functional component using React hooks.
Why?
To align with the modern React practices and improve consistency across the codebase by using functional component with React hooks. This also makes the component easier to maintain and test over time.
How?
- Replaced class based lifecycle methods with
useEffect - Used
useState,useCallbackanduseMemofor state and memoization. - Preserved all previous logic and behavior.
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.
If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
Co-authored-by: BugReportOnWeb <[email protected]>
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.
Thanks for working on this, @BugReportOnWeb!
The issue concerns web components, and we're about to remove the entire React Native infrastructure. I'm going to close this PR.