-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Closed
Description
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
).
Metadata
Metadata
Assignees
Labels
No labels