rc-dropdown is a fundamental, unstyled UI component for React applications, providing the core logic and accessibility features for dropdown menus, tooltips, and contextual overlays. It is currently at stable version 4.2.1 and is part of the extensive react-component library ecosystem, known for building highly customizable and performant UI primitives. While it offers essential dropdown functionalities like visibility control, placement, and event handling, it intentionally leaves styling and complex menu rendering to the consumer or higher-level UI libraries like Ant Design, which heavily utilize rc-dropdown internally. The project maintains an active development pace with regular updates, including refactors and minor feature enhancements, but major version bumps can introduce significant internal changes.
npm install rc-dropdownVerified import paths — ran on the pinned version, not inferred.
This example demonstrates a basic controlled dropdown component with a simple HTML overlay and a button trigger, showcasing `rc-dropdown`'s core usage including visibility management, placement, and basic animation setup.
Carefully review the project's official changelog (if available beyond commit history) and perform comprehensive regression testing on components integrating `rc-dropdown` after upgrading. Adapt custom styling or logic that might have relied on previous internal structures.
Stay informed by checking the GitHub repository for `rc-dropdown` and the broader `react-component` organization for any announcements about future migrations or package renames. Plan for potential refactoring when a new `@rc-component/dropdown` is officially stable and recommended for use.
Ensure your project's `package.json` specifies `react` and `react-dom` versions that satisfy `rc-dropdown`'s peer dependency (e.g., `^16.11.0`, `^17.0.0`, or `^18.0.0`). Run `npm install` or `yarn install` to update your dependencies, and use `npm ls react` and `npm ls react-dom` to verify installed versions.
Install the package using your package manager: `npm install rc-dropdown` or `yarn add rc-dropdown`. Double-check the import statement for correct spelling.
Ensure you are using the correct ES Module default import: `import Dropdown from 'rc-dropdown';`. Avoid `const Dropdown = require('rc-dropdown');` in ES Module contexts or `import { Dropdown } from 'rc-dropdown';` as the component is a default export.Verify that your project's `react` and `react-dom` versions satisfy `rc-dropdown`'s peer dependency requirement (>=16.11.0). Use `npm ls react` and `npm ls react-dom` to inspect versions. If multiple React instances are present, investigate your bundling configuration to deduplicate `react`.