Untitled

mail@pastecode.io avatar
unknown
plain_text
3 years ago
279 B
2
Indexable
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);
    }
});