* @param {import('preact').Ref } ref * @param {T} value * @template T
(ref, value)
| 21 | * @template T |
| 22 | */ |
| 23 | function setRef(ref, value) { |
| 24 | if (typeof ref === 'function') { |
| 25 | ref(value); |
| 26 | } else if (ref) { |
| 27 | ref.current = value; |
| 28 | } |
| 29 | } |
| 30 | |
| 31 | /** |
| 32 | * Combines refs to pass into `ref` prop. |