🛠️ Shared React utilities for rc-component packages.
See the code Part of the Ant Design ecosystem.
🛠️ Shared React utilities for rc-component packages.
English | 简体中文
This package was historically published as
rc-util. Prefer the scoped package for new code.
npm install @rc-component/util
import {
Portal,
raf,
useEvent,
useLayoutEffect,
warning,
} from '@rc-component/util';
Run the local dumi site:
npm install
npm start
Then open http://localhost:8000.
The package exposes small, focused helpers used across rc-component and Ant Design packages. Import the public entry when possible, and use subpath imports for specialized DOM, React, or test helpers.
| Area | Examples |
|---|---|
| React hooks | useEvent, useLayoutEffect, useMergedState, useState helpers |
| React utilities | Children/toArray, composeRef, pickAttrs, Portal |
| DOM utilities | Dom/canUseDom, Dom/contains, Dom/dynamicCSS, Dom/focus, getScrollBarSize |
| Async helpers | raf, raf.cancel |
| Warnings | warning, noteOnce, resetWarned |
| Tests | test/domHook for DOM prototype spies |
Examples in docs/examples cover the commonly used subpath helpers.
npm install
npm start
npm test
npm run build
The dumi site runs at http://localhost:8000 by default.
npm run prepublishOnly
The release flow is handled by @rc-component/np through the rc-np command after the package build.
@rc-component/util is released under the MIT license.
Overall
Maintained
Code review
Latest release
Releases this year
224 followers · starred Aug 2023
936 followers · starred Mar 2023
10 followers · starred Dec 2020
28 followers · starred Sep 2018
🛠️ Shared React utilities for rc-component packages.
See the code Part of the Ant Design ecosystem.
🛠️ Shared React utilities for rc-component packages.
English | 简体中文
This package was historically published as
rc-util. Prefer the scoped package for new code.
npm install @rc-component/util
import {
Portal,
raf,
useEvent,
useLayoutEffect,
warning,
} from '@rc-component/util';
Run the local dumi site:
npm install
npm start
Then open http://localhost:8000.
The package exposes small, focused helpers used across rc-component and Ant Design packages. Import the public entry when possible, and use subpath imports for specialized DOM, React, or test helpers.
| Area | Examples |
|---|---|
| React hooks | useEvent, useLayoutEffect, useMergedState, useState helpers |
| React utilities | Children/toArray, composeRef, pickAttrs, Portal |
| DOM utilities | Dom/canUseDom, Dom/contains, Dom/dynamicCSS, Dom/focus, getScrollBarSize |
| Async helpers | raf, raf.cancel |
| Warnings | warning, noteOnce, resetWarned |
| Tests | test/domHook for DOM prototype spies |
Examples in docs/examples cover the commonly used subpath helpers.
npm install
npm start
npm test
npm run build
The dumi site runs at http://localhost:8000 by default.
npm run prepublishOnly
The release flow is handled by @rc-component/np through the rc-np command after the package build.
@rc-component/util is released under the MIT license.
Overall
Maintained
Code review
Latest release
Releases this year
224 followers · starred Aug 2023
936 followers · starred Mar 2023
10 followers · starred Dec 2020
28 followers · starred Sep 2018