# useSearchQuery
A hook built on top of React Router v5 that facilitate access and manipulation of the 'search' query parameter.
### Why? 💡
- Facilitates editing the 'search' query string in the URL for the current location
- Functions similarly to the useState hook
### Basic Usage:
```jsx harmony
import { useState, useRef } from 'react';
import { HashRouter as Router } from 'react-router-dom'
import { Input, Typography, Tag } from 'antd'
import useSearchQuery from 'beautiful-react-hooks/useSearchQuery';
const ExampleComponent = () => {
const [searchValue, setSearch] = useSearchQuery('initial-value')
return (
Current value of search param is {searchValue}
setSearch(nextValue)} />
);
};
```
### Types
```typescript static
/**
* Ease the process of modify the 'search' query string in the URL for the current location.
* It's just a shortcut/wrapper around useQueryParam
*/
declare const useSearchQuery: (initialValue?: TSearchKey | undefined, replaceState?: boolean) => [TSearchKey, (nextValue?: TSearchKey | undefined) => void];
export default useSearchQuery;
```