Skip to content

Fix ReferenceError by removing obsolete hint refs and updating cleanu…#146

Open
devanshu-puri wants to merge 6 commits into
idna001:masterfrom
devanshu-puri:fix-hint-error
Open

Fix ReferenceError by removing obsolete hint refs and updating cleanu…#146
devanshu-puri wants to merge 6 commits into
idna001:masterfrom
devanshu-puri:fix-hint-error

Conversation

@devanshu-puri

@devanshu-puri devanshu-puri commented Oct 7, 2025

Copy link
Copy Markdown

This PR fixes a ReferenceError caused by obsolete hint refs (hintTimeoutRef, hintIntervalRef, hintLockedRef) that were still being referenced in the cleanup function of the main App component. The issue occurred because the hint logic was refactored into a separate hook (useHint), but the old refs were not removed.
image

Main Changes:

Removed unused hint refs from App.js.

Updated the cleanup function to remove references to the obsolete hint timers.

Ensured the hint feature now fully relies on the useHint hook for logic and state management.

Minor cleanup in App.js to improve readability and maintainability.

Benefits:

Resolves runtime errors (ReferenceError).

Improves separation of concerns between UI and hint logic.

Code is cleaner, easier to read, and maintainable.

Related Task: #142

@vercel

vercel Bot commented Oct 7, 2025

Copy link
Copy Markdown

Someone is attempting to deploy a commit to the idna001's projects Team on Vercel.

A member of the Team first needs to authorize it.

@idna001 idna001 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Hi, there is probably missing some uncommited changes

@devanshu-puri

Copy link
Copy Markdown
Author

@idna001 let me check , will update soon

@devanshu-puri

Copy link
Copy Markdown
Author

@idna001 all update i have updated kindly check

@idna001 idna001 requested a review from Copilot October 7, 2025 18:22

Copilot AI left a comment

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.

Pull Request Overview

This PR fixes a ReferenceError by removing obsolete hint-related refs from the main App component and refactoring hint functionality into a separate custom hook. The changes modernize the React rendering API and improve code organization.

  • Extracts hint logic into a reusable useHint custom hook
  • Removes obsolete hint refs and state from App component that were causing runtime errors
  • Updates React rendering to use the modern createRoot API

Reviewed Changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/utils/useHint.js New custom hook containing all hint-related logic and state management
src/App.js Removes obsolete hint refs and integrates useHint hook, fixes cleanup function
src/index.js Updates to modern React 18 createRoot API
src/components/singlecard/SingleCard.js Improves conditional rendering of card images
public/index.html Updates mobile web app meta tag

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread src/utils/useHint.js
Comment thread src/utils/useHint.js Outdated
Comment thread src/App.js
devanshu and others added 2 commits October 8, 2025 09:00
Signed-off-by: Andreas V <46223359+idna001@users.noreply.github.com>
@vercel

vercel Bot commented Oct 8, 2025

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
aa-memory Ready Ready Preview Comment Oct 8, 2025 6:00pm

Comment thread src/App.js Outdated
Signed-off-by: Andreas V <46223359+idna001@users.noreply.github.com>

@idna001 idna001 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Not sure, if this is from merging. But in demo the feature is broken

@idna001

idna001 commented Oct 8, 2025

Copy link
Copy Markdown
Owner

Please see Preview: https://aa-memory-git-fork-devanshu-puri-fix-h-56152a-idna001s-projects.vercel.app/
Hint Button doesnt open cards anymore

@idna001

idna001 commented Oct 8, 2025

Copy link
Copy Markdown
Owner

Also there 5 new sonarcloud issues

@devanshu-puri

Copy link
Copy Markdown
Author

@idna001 can you mention the issues , i wil try to fix all that and send final request wih all fixes

@idna001

idna001 commented Oct 9, 2025

Copy link
Copy Markdown
Owner

Signed-off-by: CodeKenshinDev <72023898+devanshu-puri@users.noreply.github.com>
@devanshu-puri

Copy link
Copy Markdown
Author

@idna001 check it and update

@sonarqubecloud

Copy link
Copy Markdown

@devanshu-puri

Copy link
Copy Markdown
Author

@idna001 I have created fixes in another branch name fix-error and everything works fine including the hint button , kindly check and update it
☺️

@devanshu-puri

Copy link
Copy Markdown
Author

@idna001 Everything's fine check it.

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.

3 participants