Untitled

mail@pastecode.io avatar
unknown
plain_text
2 years ago
512 B
2
Indexable
Never
import axios from "axios";
import { useEffect } from "react";
import { access_token } from "../utils/constants";

export const useFetch = url => {
	const [data, setData] = useState();

	useEffect(() => {
		axios.get(`${url}${access_token}`).then(function (response) {
			const response = useFetch(
				"https://us.api.blizzard.com/data/wow/search/item?namespace=static-us&name.en_US=sword&orderby=id&_page=1"
			)
				.then(setData(response))
				.then(console.log(response));
		});
	}, []);
};