์๊ฐ
๐ ๏ธ rc-component ํจํค์ง์์ ๊ณต์ ํ๋ React ์ ํธ๋ฆฌํฐ์ ๋๋ค.
์น ๋ฐ ์ฑ ๊ฐ๋ฐWhat you can do
- Built for React and maintained by the rc-component team.
- Used by Ant Design and other React component libraries.
- Ships TypeScript declarations with both ES module and CommonJS outputs.
- Keeps examples, tests, and preview builds aligned with the package source.
์ธก์ ๋ ์คํ ์ฆ๊ฐ
- in 24h
- 0
- in 7 days
- 0
- in 15 days
- 0
- in 1 month
- ๊ธฐ๋ก ์์ง ์ค
์๋ก ๊ฒน์น๋ ๊ธฐ๊ฐ์ ์์ฆ๊ฐ๋์ด๋ฉฐ ์ผ๋ณ ํฉ๊ณ๊ฐ ์๋๋๋ค. ์ธก์ ๊ฐ์ด ์์ผ๋ฉด ๋น์ ๋ก๋๋ค. ์คํ๋ ๊ด์ฌ๋๋ฅผ ๋ํ๋ด๋ฉฐ ํ์ง์ ๋ณด์ฅํ์ง ์์ต๋๋ค.
README.md
Original@rc-component/util
Part of the Ant Design ecosystem.
๐ ๏ธ Shared React utilities for rc-component packages.
English | ็ฎไฝไธญๆ
Highlights
- Built for React and maintained by the rc-component team.
- Used by Ant Design and other React component libraries.
- Ships TypeScript declarations with both ES module and CommonJS outputs.
- Keeps examples, tests, and preview builds aligned with the package source.
This package was historically published as
rc-util. Prefer the scoped package for new code.
Install
npm install @rc-component/util
Usage
import {
Portal,
raf,
useEvent,
useLayoutEffect,
warning,
} from '@rc-component/util';
Examples
Run the local dumi site:
npm install
npm start
Then open http://localhost:8000.
API
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.
Development
npm install
npm start
npm test
npm run build
The dumi site runs at http://localhost:8000 by default.
Release
npm run prepublishOnly
The release flow is handled by @rc-component/np through the rc-np command after the package build.
License
@rc-component/util is released under the MIT license.
๊ด๋ จ ํ๋ก์ ํธ ์ดํด๋ณด๊ธฐ
๋ถ๋ฌ์ค๋ ์คโฆ