import { Dispatch } from 'react' ; import { Atom , WritableAtom } from './atom' ; import { useAtomValue } from './useAtomValue' ; import { useSetAtom } from './useSetAtom' ; export function useAtom < Value , Update > ( atom ) ; export function useAtom < Value > ( atom ) ; export function useAtom < Value , Update > ( atom ) { return [ useAtomValue ( atom ) , useSetAtom ( atom as WritableAtom < Value , Update > ) ] ; }