Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chapter 8: repository menu carousel #163

Open
stardvst opened this issue Aug 6, 2022 · 0 comments
Open

chapter 8: repository menu carousel #163

stardvst opened this issue Aug 6, 2022 · 0 comments

Comments

@stardvst
Copy link

stardvst commented Aug 6, 2022

when the entered user has no public repos, the following error is printed:

Cannot read properties of undefined (reading 'name')

i fixed RepoMenu.js with the following code. if you know better way to destructure the array, please suggest.

  const [repo, previous, next] = useIterator({ items: repos });
  const name = repo?.name;

also notice, you need to pass useIterator({ items: repos }) instead of useIterator(repos) (useIterator receives a prop named items).

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

No branches or pull requests

1 participant