import { Meta } from '@storybook/blocks'; # useUserActivityState The `useUserActivityState` hook returns the state of the user activity. ### Return Value ```javascript { // Whether or not the the user is active isUserActive: boolean | null; } ``` ## Importing ```javascript import { useUserActivityState } from 'amazon-chime-sdk-component-library-react'; ``` ## Usage The hook depends on the `UserActivityProvider`. ```jsx import React from 'react'; import { UserActivityProvider, useUserActivityState, } from 'amazon-chime-sdk-component-library-react'; const App = () => ( ); const MyChild = () => { const { isUserActive } = useUserActivityState(); return isUserActive ?
Active
:
Not active
; }; ``` ### Dependencies - `UserActivityProvider`