Skip to content

Conversation

@Hammad-hab
Copy link

This pull request fixes the repeated-image bug in the “Pygame Powered” section of the home page.
On initial load, multiple cards display the same image. The root cause was the use of data-info attributes to store application state in the DOM. In Next.js this pattern is unreliable due to SSR/CSR transitions and should not be used for state management.

What was changed

  • Removed reliance on data-* attributes for storing state.
  • Added a unique event-handler generator (changeBackgroundForSpecificID) so each card has its own stable mouse-enter handler.
  • Eliminated the conditional fallback logic for currentGameId, since state is now predictable.
  • Refactored powered.tsx into a modern function component using React hooks (useState, useCallback).

Fixes #40

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.

Problem with "Pygame Powered" section

2 participants