# Function useRecoilState

- useRecoilState<T>(recoilState): [T, SetterOrUpdater<T>]

- Returns a tuple where the first element is the value of the recoil state and the second is a setter to update that state. Subscribes component to updates of the given state.

  #### Type Parameters

  - T

  #### Parameters

  - recoilState: RecoilState<T>

  #### Returns [T, SetterOrUpdater<T>]

  - Defined in common/temp/node_modules/.pnpm/recoil@0.7.7_react-dom@18.3.1+react@18.3.1/node_modules/recoil/index.d.ts:245