Skip to content

React component: Infinite loop if peaks option is specified #3954

Answered by katspaugh
Yorams asked this question in Q&A
Discussion options

You must be logged in to vote

Yes, normally it shouldn't cause an infinite loop though, so there's some combination of factors at play. But either way it's not good to pass literal objects/arrays/functions as React props. They should be memoized with useMemo/useCallback as per your workaround.

Replies: 2 comments 3 replies

Comment options

Yorams
Dec 4, 2024
Author Sponsor

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
3 replies
@Yorams
Comment options

Yorams Dec 4, 2024
Author Sponsor

@katspaugh
Comment options

Answer selected by Yorams
@Yorams
Comment options

Yorams Dec 4, 2024
Author Sponsor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #3953 on December 04, 2024 08:18.