Closed aleksandar-vasic-ananas closed 2 months ago
Not just React Native. In a node app, with search-insights 2.15.0:
ReferenceError: localStorage is not defined
at LocalStorage.get (~/.../.yarn/cache/search-insights-npm-2.15.0-99e33c6255-87b5ca470d.zip/node_modules/search-insights/dist/search-insights-node.cjs.min.js:1:699)
I was using search-insights inside my React Native project, and everything was fine. After I moved to version 2.15.0, I started getting the error "Property 'localStorage' doesn't exist."
VERSION: 2.14.0
VERSION: 2.15.0
I detected the issue inside clickedObjectIDsAfterSearch, since from version 2.15.0, they added the function storeQueryForObject that talks to local storage. Since React Native doesn't use local storage, can you please do something about it?
Maybe you could set it so that if it’s a mobile phone, it uses AsyncStorage or MMKV, or even better, add functionality where we can pass the storage we use.