-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed the Function Component Example (#2019)
* Fixed the Function Component Example We experienced that the documentation was faulty so after we at @enpit found a fix, we wanted to share it with you. The old trigger `appState.current.match(/inactive|background/) && nextAppState === "active"` would never work because the useState hook doesn't update the state fast enough for the function to work. The solution is to use useRef instead and optional (to display the inactive status under iOS) also use a `useState` for cosmetics. * removed block comment, removed spaces * rephrase and move new comment, add one more sentence, prettier run * language lint fix Co-authored-by: Bartosz Kaszubowski <gosimek@gmail.com>
- Loading branch information
1 parent
8e4a003
commit d2e222e
Showing
1 changed file
with
16 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters