gutenberg icon indicating copy to clipboard operation
gutenberg copied to clipboard

Refactor: Convert native `Dropdown` to functional component

Open BugReportOnWeb opened this issue 1 year ago • 2 comments

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, useCallback and useMemo for state and memoization.
  • Preserved all previous logic and behavior.

BugReportOnWeb avatar Jun 17 '25 08:06 BugReportOnWeb

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.

github-actions[bot] avatar Jun 18 '25 09:06 github-actions[bot]

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.

Mamaduka avatar Jun 09 '26 07:06 Mamaduka