# Function useBlocker

- useBlocker(shouldBlock): Blocker

- Allow the application to block navigations within the SPA and present the user a confirmation dialog to confirm the navigation. Mostly used to avoid using half-filled form data. This does not handle hard-reloads or cross-origin navigations.

  #### Parameters

  - shouldBlock: boolean | BlockerFunction

  #### Returns Blocker

  - Defined in common/temp/node_modules/.pnpm/react-router@6.23.1_react@18.3.1/node_modules/react-router/dist/lib/hooks.d.ts:180