React Hook, Hooks, React.
console.log(res) setPosts(res.data) }) .catch(error => { console.log(error) }) .finally(() => { console.log(‘always executed’) }) }, [])//passing empty array here cause component did mount only once return ( <div> { posts.map(post => ( <li key={post.id}>ID:{post.id}-:{post.title}</li> )) } </div> )