Closed Fxlr8 closed 3 years ago
Do you mean the memory storage object? Can you use it by importing it via import storage from 'useLocalStorageState/src/storage'
?
I tried
Here is a CodeSandbox example showing how you can make it work: https://codesandbox.io/s/todos-example-forked-di7u8?file=/src/App.tsx
Thank you for the example, but I am still not sure what am I doing wrong here. I am not using create-react-app. Does it have something to do with webpack config or tsconfig?
Aha. I think I know the reason. You are probably not on the latest version. Can you try to upgrade and try again?
@Fxlr8 I hope you found the reason it wasn't working for you. Let me know if you haven't.
I am closing this issue because it's possible to get access to the storage object without implementing a new API.
Hi, it would be very handy in my case to be able to consistently read from the local storage outside of React scope. Could you please export the storage object?