You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: Next button throws a runtime error instead of cycling to the first sculpture #8634
On the State: A Component's Memory page, the Sculpture Gallery example allows users to navigate through sculptures using the Next button. The gallery works correctly while navigating through valid entries, but when the user clicks Next on the final sculpture (12 of 12), the application does not cycle back to the first sculpture.
Instead, the index exceeds the sculpture list bounds, making sculpture undefined and causing the runtime error:
App.js: can't access property "name", sculpture is undefined
Expected: The gallery should wrap around from the last sculpture to the first sculpture when Next is clicked.
Actual: The application throws a runtime error because it attempts to access properties such as sculpture.name on an undefined object.
Hey I would like to work on it. I'll just add % sculptureList.length wherever necessary
Modulo operator is not a standard that is followed in this repository, I have already raised a PR for this issue following the implementation practices. Check it out. https://github.com/reactjs/react.dev/pull/8635
Activity
Saurav10codes commentedon Sep 4, 2026
Hey I would like to work on it. I'll just add
% sculptureList.lengthwherever necessaryArya-00 commentedon Sep 4, 2026
Modulo operator is not a standard that is followed in this repository, I have already raised a PR for this issue following the implementation practices. Check it out.
https://github.com/reactjs/react.dev/pull/8635
kamalhara commentedon Sep 13, 2026
The issue is still not solved yet.
should i work on it?