# `useError`
React side-effect hook that returns an error dispatcher.
## Usage
```jsx
import { useError } from 'react-use';
const Demo = () => {
const dispatchError = useError();
const clickHandler = () => {
dispatchError(new Error('Some error!'));
};
return ;
};
// In parent app
const App = () => (
);
```
## Reference
```js
const dispatchError = useError();
```
- `dispatchError` — Callback of type `(err: Error) => void`