Skip to content

week5 hw#4

Open
ryancfields wants to merge 1 commit into
frontend-application-development-uw20:masterfrom
JS300A:master
Open

week5 hw#4
ryancfields wants to merge 1 commit into
frontend-application-development-uw20:masterfrom
JS300A:master

Conversation

@ryancfields
Copy link
Copy Markdown

Week 5 HW Submission

Please fill out the information below in order to complete your assignment. Feel free to update this comment later if necessary.

  • Comfort rating on this assignment (1-5): 5
  • Completion rating on this assignment: complete

Comment thread rickandmorty/package.json
"@testing-library/react": "^9.5.0",
"@testing-library/user-event": "^7.2.1",
"bootstrap": "^4.5.0",
"react": "^16.13.1"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure what happened here, but the dependencies list is missing react-dom, react-router-dom, and react-scripts

fetch(`https://rickandmortyapi.com/api/character/${id}`)
.then((res) => res.json())
.then((data) => characterDetail(data));
});
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just for future reference, the example I showed in the week 5 code examples had a mistake. There should be an empty array as a second parameter for useEffect, otherwise it causes an infinite loop and keeps fetching the data unnecessariliy.

https://medium.com/@andrewmyint/infinite-loop-inside-useeffect-react-hooks-6748de62871

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants