Coder Social home page Coder Social logo

react_axios_requests's Introduction

react_axios_requests's People

Contributors

gitdagray avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

react_axios_requests's Issues

Cleanup useEffect in tute20

Hi Dave
In tute20, when we are learning custom hook for window resizing event. You showed at 6:56:20 time stamp, that cleanup functions calls as soon as we reload the app. That means the eventListener might be removed during cleanup.
Then how were you able to resize the window and get the updated size in Header?

useEffect

Hello Dave, useEffect not working, data not showing up on home page . Waiting for your response.

useEffect(() => {
const fetchPosts = async () => {
try {
const response = await api.get("/posts");
setPosts(response.data);
setPosts(response.data)
} catch (err) {
if (err.response) {
// Not in the 200 response range
console.log(err.response.data);
console.log(err.response.status);
console.log(err.response.headers);
} else {
console.log(Error: ${err.message});
}
}

}

Why all the posts need to be injected in EditPost component?

Hi Dave
I was wondering, for editing a single post why do we need to pass the array of posts in EditPost component and then internally filter it by id? Rather we can simply pass the Post object as prop directly.

The same logic is true while we are showing the Post component.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.