DEV Community

loading...

Discussion on: Build a Blog App with React —Building Components (Part 2)

Collapse
maswerdna profile image
Samson Andrew
const {data: blogs, isPending, error} = useFetch('http://localhost:8000/blogs');

<BlogList blogs={blogs} title="All Blogs"/>
Enter fullscreen mode Exit fullscreen mode

From the two lines above, is it possible to reference blog directly in the BlogList component or something missing?

Collapse
shubham1710 profile image
Kumar Shubham Author

We yet have to build the useFetch custom hook. If the useFetch custom hook is written then yes, we can do this. I will deal with all the leftover functions in part 3 and 4.

Collapse
maswerdna profile image
Samson Andrew

That's right. I've seen the updated article. Thanks