Skip to main content
Module

x/jotai/docs/utils/use-reset-atom.mdx

👻 Primitive and flexible state management for React
Go to Latest
File
---title: useResetAtom---
```tsfunction useResetAtom<Value>( anAtom: WritableAtom<Value, typeof RESET>): () => void | Promise<void>```
Resets a [Resettable atom](../guides/resettable.mdx) to its initial value.
## Example
```jsximport { useResetAtom } from 'jotai/utils'import { todoListAtom } from './store'
const TodoResetButton = () => { const resetTodoList = useResetAtom(todoListAtom) return <button onClick={resetTodoList}>Reset</button>}```