You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
when providing an initial value to the createChromeStorageStateHookLocal hook, and trying to access the data from chrome.storage.local.get, it returns undefined instead of the initial false.
P.S.: the hook is already mounted by the timechrome.storage.local.get was called.
It's the behavior of chrome.storage.
It doesn't set an init/ial value. It only uses it if no value stored.
// say isDark not stored in storage yet (undefined)// getting isDark and providing initial valueconstoptions=awaitchrome.storage.sync.get({isDark: true});constole.log(options.isDark);// true (initial value used)// getting isDark without initial valueconstoptions1=awaitchrome.storage.sync.get('isDark');constole.log(options1.isDark);// undefined (we did not set isDark yet and did not provide init value)
when providing an initial value to the
createChromeStorageStateHookLocal
hook, and trying to access the data fromchrome.storage.local.get
, it returnsundefined
instead of the initialfalse
.P.S.: the hook is already mounted by the time
chrome.storage.local.get
was called.The text was updated successfully, but these errors were encountered: