- Add Dice UI responsive-dialog component - Move manual booking form to dialog (drawer on mobile) - Filter past time slots when booking for today - Rename button to 'Nueva Reserva'
14 lines
237 B
TypeScript
14 lines
237 B
TypeScript
import * as React from 'react';
|
|
|
|
function useLazyRef<T>(fn: () => T) {
|
|
const ref = React.useRef<T | null>(null);
|
|
|
|
if (ref.current === null) {
|
|
ref.current = fn();
|
|
}
|
|
|
|
return ref as React.RefObject<T>;
|
|
}
|
|
|
|
export { useLazyRef };
|