text: import { useState, useEffect } from 'react';
  function useFetch(url, params) {
    const [data, setData] = useState([]);
    const [loading, setLoading] = useState(true);
    async function fetchUrl() {
      const response = await fetch(url, params);
      const json = await response.json();
      setData(json);
      setLoading(false);
    }
    useEffect(() => {
      fetchUrl();
    }, []);
    return [data, loading];
  }
  export { useFetch };
  