useStorage between two content script components in React
Hi! I’m trying to figure out how to use the useStorage hook. In one component, I do:
And in a different component, I tried doing this to log the updated value:


I do get the console.log updates in the first component when my custom hook “useSelectedSubtitlesLanguage” is triggered, but in the second component the state “storedLanguage” is initially undefined, and then null.


The two components are in separate content scripts that are injected inline.


What I am doing wrong?


I also cloned the -with-storage example, which does work, but I can’t figure out what I’m doing differently.


Thank you!
4 Replies
@louis
@louis
@tetec1 has reached level 5. GG!
okay, I think I figured it out, for some reason pnpm didn't install the correct version of the package, and putting it in the devDependencies in my package.json didn't work.
so yes, ""@plasmohq/storage" must be in the dependencies, not the devDependencies.