Initial commit
This commit is contained in:
commit
78f8d225ee
21173 changed files with 2907774 additions and 0 deletions
15
node_modules/use-callback-ref/dist/es2015/useTransformRef.d.ts
generated
vendored
Normal file
15
node_modules/use-callback-ref/dist/es2015/useTransformRef.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
import { ReactRef, RefObject } from './types';
|
||||
/**
|
||||
* Create a _lense_ on Ref, making it possible to transform ref value
|
||||
* @param {ReactRef} ref
|
||||
* @param {Function} transformer. 👉 Ref would be __NOT updated__ on `transformer` update.
|
||||
* @returns {RefObject}
|
||||
*
|
||||
* @see https://github.com/theKashey/use-callback-ref#usetransformref-to-replace-reactuseimperativehandle
|
||||
* @example
|
||||
*
|
||||
* const ResizableWithRef = forwardRef((props, ref) =>
|
||||
* <Resizable {...props} ref={useTransformRef(ref, i => i ? i.resizable : null)}/>
|
||||
* );
|
||||
*/
|
||||
export declare function useTransformRef<T, K>(ref: ReactRef<K>, transformer: (original: T | null) => K): RefObject<T>;
|
||||
Loading…
Add table
Add a link
Reference in a new issue