scrnli_8_8_2022_8-39-49.AM.mp4
- React
- Context API
- Tailwind CSS
- Google Search API
const UseGoogleSearch = (term) => {
const [data, setData] = useState(null);
useEffect(() => {
const fetchData = async () => {
fetch(`https://www.googleapis.com/customsearch/v1?key=${API_KEY}&cx=${CONTEXT_KEY}&q=${term}`)
.then(response => response.json())
.then(result => {
setData(result)
})
}
fetchData().then(res => {
console.log(res);
}).catch(error => {
console.log(error);
});
}, [term]);
return {data};
};
- Linkedin - usamabinkashif
- Frontend Mentor - @UsamaBinKashif