I have a react table that looks more or less like this:
<ReactTable
          ref={tableRef}
          style={{ minHeight: "80vh" }}
          className="-highlight -striped  text-center"
          data={data}
          loading={isLoading}
          loadingText={getLoadingMessage("Fetching users...")}
          noDataText="No users found..."
          columns={getColumns()}
          filterable={false}
          minRows={0}
          pageSizeOptions={[10, 13, 20, 50, 100]}
          defaultPageSize={10}
          onFetchData={tableState => getUsers({ tableState, searchValue })}
/>
I want to use query params so that I can have in my link, depending on the page and rows, something like this ?page=3&rows=50. How can I implement this using hooks?
This is how getUsers looks like:
getUsers: thunk(async (actions, { tableState, searchValue }) => {
    actions.setIsLoading(true);
    let QUERIES = getQueryParamsFromTable(tableState, searchValue);
    try {
      const { data } = await api.get(urlParamReplacer(AUTH.USERS), {
        params: QUERIES
      });
      actions.setUsers(data);
    } catch (error) {
      actions.setIsLoading(false);
      console.error(error);
    }
  }),
and this is setIsLoading:
setIsLoading: action((state, payload) => {
    state.isLoading = payload;
  }),
				
                        
You can create a custom hook to return the query parameters or implement the use-query-params library.
With the use-query-params library, it can be implemented with the following code:
Here is an example with a custom hook: