import { useState } from 'react'; export function useConstant(value: T | (() => T)): T { return useState(value)[0]; }