UNPKG

@hypothesis/frontend-shared

Version:

Shared components, styles and utilities for Hypothesis projects

12 lines 421 B
/** * Helper for downcasting a ref to a more specific type, where that is safe * to do. * * This is mainly useful to cast a generic `Ref<HTMLElement>` to a more specific * element type (eg. `Ref<HTMLDivElement>`) for use with the `ref` prop of a JSX element. * Since Preact only writes to the `ref` prop, such a cast is safe. */ export function downcastRef(ref) { return ref; } //# sourceMappingURL=typing.js.map