-
Notifications
You must be signed in to change notification settings - Fork 25.1k
Settings API - issue with watchKeys function callback #28213
Description
Description:
This issue was reported a while ago and become "stale": #21607
I was working on the updates and Snack example for the Settings API website page (refs.: facebook/react-native-website#1579) and I have stumble upon a problem. It seems like Settings.watchKeys function callback isn't fired properly.
I have studied the source code (https://github.com/facebook/react-native/blob/1151c096dab17e5d9a6ac05b61aacecd4305f3db/Libraries/Settings/Settings.ios.js) to confirm that I have done everything right, but there is still a possibility of an issue in my code since I was never earlier working with this API.
Nonetheless Settings.set and Settings.get method seems to work properly. After pressing one of the buttons and than changing example in the editor App preview will be refreshed and stored value will be updated correctly.
React Native version:
expo 36.0.0
Steps To Reproduce
- Setup
Settings.watchKeyswith a callback. - Change key value using
Settings.set. - Callback isn't fired.
Expected Results
watchKeys function should fire callback on value change.