Quantcast
Channel: Active questions tagged react-native+ios - Stack Overflow
Viewing all articles
Browse latest Browse all 16750

React Native Settings.set() API method is not working as expected

$
0
0

Environment:

react: "16.8.3"

react-native: "0.59.3"

Description:

I'm trying to use React Native's Settings API. To be specific, I'm setting a key/value pair in NSUserDefaults via Settings as follows,

    try {
      Settings.set({
        foo: 'bar',
      })
    } catch (e) {
      console.error(e)
    }

However, I'm getting following error,

Object.assign requires that input parameter not be null or undefined

Error Screenshot

Is this API working fine? Or am I using it incorrectly?

I see that there is a similar issues in Expo GitHub repo: https://github.com/expo/expo/issues/2133. In this issue, I found a comment saying its deprecated due to security concerns. Is that true only for Expo or Settings API in general?


Viewing all articles
Browse latest Browse all 16750

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>