title: How can I re-trigger a custom hook inside my react component, when its states have not changed?
body: <p>I have a custom hook for fetching data from the server. It takes 3 parameters, which are pageNumber, pageSize, and keyword. I understand if I set one or more of these parameters, the hook gets re-triggered with the new state. But In my component, there is a place when I create data, so once it is created it has to fetch the data again. But none of its parameters, like pageNumber, pageSize and keyword has been updated. I just need it to run once again, to fetch the new data. How do I do this, without changing my states? (in the code below, 'Adapter' is an Axios intance)</p>
  <p>This is the hook:</p>
  <pre><code>const useFetchLists = (
    url = '',
    currentPage = 1,
    selectedPageSize = 10,
    keyword = ''
  ) =&gt; {
    const [items, setItems] = useState([]);
    const [loading, setloading] = useState(false);
    const [totalPage, setTotalPage] = useState(1);
    const [totalItemCount, setTotalItemCount] = useState(0);
  
    useEffect(() =&gt; {
      const fetchListData = async () =&gt; {
        try {
          setloading(true);
          await Adapter.get(
            `${url}?pageNumber=${currentPage}&amp;pageSize=${selectedPageSize}&amp;keyword=${keyword}`,
            {}
          ).then((response) =&gt; {
            setItems(response.data.items);
            setTotalPage(response.data.totalPages);
            setTotalItemCount(response.data.totalItems);
          });
        } catch (err) {
        } finally {
          setloading(false);
        }
      };
      fetchListData();
    }, [url, currentPage, selectedPageSize, keyword]);
  
    return [items, loading, totalPage, totalItemCount];
  };
  
  export default useFetchLists;
  
  </code></pre>
  <p>and this is how I used it in my component, on the initial load of the page.</p>
  <pre><code> const [currentPage, setCurrentPage] = useState(1);
    const [selectedPageSize, setSelectedPageSize] = useState(10);
    const [keyword, setKeyword] = useState('');
    const [items, loading, totalPage, totalItemCount] = useFetchLists(
      ADD_BRAND_URL,
      currentPage,
      selectedPageSize,
      keyword
    );
  </code></pre>
  <p>I want to be able to re-trigger the hook, without setting any of its states because they have not changed, but the data has changed so it has to fetch again.</p>