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

Profile hero fields are flashing #984

Closed
vidvidvid opened this issue Dec 20, 2021 · 3 comments · Fixed by #985
Closed

Profile hero fields are flashing #984

vidvidvid opened this issue Dec 20, 2021 · 3 comments · Fixed by #985
Labels
bug Something isn't working good 1ˢᵗ issue Easier tasks for new contributors high High Priority

Comments

@vidvidvid
Copy link
Collaborator

vidvidvid commented Dec 20, 2021

What happened?

All of the profile hero items are flashing and availability is not even displayed. Happens both locally and in production. Probably the fields are constantly being rerendered for some reason.

What did you expect to happen?

The profile hero data should not be flashing :P

How can we reproduce the problem (as minimally as possible)?

go to http://localhost:3000/player/vid
or https://my.metagame.wtf/player/vid

try other players as well

Is there anything else we need to know?

related pr: #963

Assets

flashing

@vidvidvid vidvidvid added the bug Something isn't working label Dec 20, 2021
@vidvidvid
Copy link
Collaborator Author

@firattale maybe you could look into it?

@vidvidvid vidvidvid added good 1ˢᵗ issue Easier tasks for new contributors high High Priority labels Dec 20, 2021
@vidvidvid
Copy link
Collaborator Author

Yup, did a little bit of logging and it seems like the component is rerendering like there's no tomorrow. Some vicious loop is going on.

@vidvidvid
Copy link
Collaborator Author

vidvidvid commented Dec 20, 2021

Sorry @firattale 😅 I went ahead and fixed the useAnimation hook that you made and implemented it in other profile sections. I just compared the old and new values and didn't retrigger the animation if they were the same. Somehow the depends value from useEffect was always different. Probably because

  1. in the component the depends variable was set
  2. it triggered the useAnimation
  3. the animation triggered the rendering of the component
  4. the depends variable was again set and even though its value might have been the same, its reference wasn't, so this loop kept on repeating.

Not sure if this is the right interpretation, but I think what happened was probably something along these lines.
PR: #985

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good 1ˢᵗ issue Easier tasks for new contributors high High Priority
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant