rc-util
- Version 5.43.0
- Published
- 241 kB
- 2 dependencies
- MIT license
Install
npm i rc-util
yarn add rc-util
pnpm add rc-util
Overview
Common Utils For React Component
Index
Functions
function get
get: ( entity: any, path: (string | number | symbol)[] | readonly (string | number | symbol)[]) => any;
function set
set: <Entity = any, Output = Entity, Value = any>( entity: Entity, paths: Path, value: Value, removeIfUndefined?: boolean) => Output;
function supportNodeRef
supportNodeRef: <T = any>(node: React.ReactNode) => node is any;
function supportRef
supportRef: (nodeOrComponent: any) => boolean;
function useComposeRef
useComposeRef: <T>(...refs: React.Ref<T>[]) => React.Ref<T>;
function useEvent
useEvent: <T extends Function>(callback: T) => T;
function useMergedState
useMergedState: <T, R = T>( defaultStateValue: T | (() => T), option?: { defaultValue?: T | (() => T); value?: T; onChange?: (value: T, prevValue: T) => void; postState?: (value: T) => T; }) => [R, Updater<T>];
Similar to
useState
but will use props value if provided. Note that internal use rc-utiluseState
hook.
function warning
warning: typeof warningOnce;
See Also
Same as warning, but only warn once for the same message
Namespaces
namespace warning
namespace warning {}
variable noteOnce
var noteOnce: (valid: boolean, message: string) => void;
variable resetWarned
var resetWarned: () => void;
function preMessage
preMessage: (fn: preMessageFn) => void;
Package Files (7)
Dependencies (2)
Dev Dependencies (26)
- @rc-component/father-plugin
- @testing-library/react
- @types/jest
- @types/node
- @types/react
- @types/react-dom
- @types/react-is
- @types/responselike
- @types/warning
- @umijs/fabric
- create-react-class
- cross-env
- dumi
- eslint
- eslint-plugin-jest
- eslint-plugin-unicorn
- father
- glob
- husky
- lint-staged
- np
- prettier
- rc-test
- react
- react-dom
- typescript
Peer Dependencies (2)
Badge
To add a badge like this oneto your package's README, use the codes available below.
You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/rc-util
.
- Markdown[![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/rc-util)
- HTML<a href="https://www.jsdocs.io/package/rc-util"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>
- Updated .
Package analyzed in 2994 ms. - Missing or incorrect documentation? Open an issue for this package.