rc-util is a foundational utility library within the React ecosystem, specifically developed to provide common helper functions and components for other React libraries (often those under the `react-component` organization like Ant Design). It offers a suite of low-level utilities such as `createChainedFunction` for combining multiple event handlers, a `deprecated` logger for warning about API changes, and `Portal` for rendering children outside the DOM hierarchy. The current stable version is `5.44.4`. While a specific, detailed release cadence for `rc-util` is not directly specified in the available metadata, the project is actively maintained, receiving updates to address various React development challenges and support newer React versions, as evidenced by related package activity. Its key differentiator lies in its focused, unopinionated approach, providing essential building blocks without imposing architectural patterns, making it a reliable dependency for complex UI component libraries.
npm install rc-utilVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to use `createChainedFunction` to combine multiple event handlers and `Portal` to render content into a specific DOM node, which is useful for overlays or modals.
Always refer to the specific import paths detailed in the `rc-util` documentation or examples, typically `import MyUtil from 'rc-util/lib/myUtil';`.
Always check the `rc-util` changelog and release notes for compatibility with new React versions. Upgrade `rc-util` to the latest version compatible with your React installation.
When troubleshooting or seeking new features, ensure you are referencing the documentation and changelog specific to the `rc-util` package and your installed version, not potentially related scoped packages.
Install the package using your package manager: `npm install rc-util` or `yarn add rc-util`.
Adjust your import statement to `import createChainedFunction from 'rc-util/lib/createChainedFunction';` for ESM, or `const createChainedFunction = require('rc-util/lib/createChainedFunction');` for CJS.Ensure components or hooks that rely on browser APIs are executed only in client-side environments, or use appropriate SSR guards like `typeof window !== 'undefined'` to conditionally render or execute code.