Untitled

mail@pastecode.io avatar
unknown
plain_text
2 years ago
279 B
1
Indexable
Never
useEffect(async () => {
    try {
        const response = await fetch(`https://www.testwebsite.com/response.json`);
        const json = await response.json();
        setPosts(json.data.children.map(it => it.data));
    } catch (e) {
        console.error(e);
    }
});