@adyen/kyc-components
Version:
`adyen-kyc-components` provides the required pieces to build an onboarding flow based on a legal entity. To onboard and verify users, you need to create a user interface (UI) to collect user data. To speed up building your integration, Adyen offers onboar
17 lines (16 loc) • 885 B
TypeScript
/**
* This is a 'hacky' way to handle components which may have props either controlled or uncontrolled.
*
* Avoid using it if at all possible - generally it's better to write a controlled inner component
* and simply make an uncontrolled version which wraps it.
*
* * If controlled, we mirror the prop state and propagate changes upwards via {@link propOnChange}.
* * If uncontrolled, it is effectively a simple {@link useState()}.
*
* *Note: if mirroring, both `prop` and `propOnChange` **must** be provided.*
*
* @param prop the prop to be mirrored
* @param propOnChange the handler to propagate changes from below back upwards
* @param defaultVal the default value, only used if we aren't mirroring
*/
export declare function useMirrorProp<T>(prop: T | undefined, propOnChange: ((newVal: T) => void) | undefined, defaultVal: T | (() => T)): [T, (newVal: T) => void];