Skip to content

[Custom Hook] is my usage of custom hook right? or it's a react bug? #15092

Closed
@kkdev163

Description

@kkdev163

//Re-edit by Dan's suggestion at Wed Mar 13 2019 12:38:13 GMT+0800
Do you want to request a feature or report a bug?
I want to report a potential bug, or maybe it's just my code cause this bug?

What is the current behavior?
I followed the official document to create a custom hook demo, the example is here. In this demo, I have 3 references of custom hook [useFriendStatus], but the state is not identical unless I add [] as 2nd params of useEffect(as line 70). wait for 10 seconds, the label(online/offline) was not matched the followed green indicator and picker 's green indicator.

What is the expected behavior?
use or not use [] as 2nd params will not impact the rendering behavior, but only the performance.

Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions