Skip to content

onDataReceived prints 8 times when receiving a signal #221

Discussion options

You must be logged in to vote

If you're in use effect with a condition you shouldn't need an if statement. There may be an issue with the way react equals the condition? If you're seeing it set the listener multiple times.

You should also be using a cleanup in use effect for things that need to unsubscribe.

Replies: 4 comments 3 replies

Comment options

You must be logged in to vote
1 reply
@ValentinOsvaldo
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by ValentinOsvaldo
Comment options

You must be logged in to vote
2 replies
@kenjdavidson
Comment options

@ValentinOsvaldo
Comment options

Comment options

You must be logged in to vote
0 replies
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