callumlocke / json-formatter

Makes JSON easy to read.
https://chrome.google.com/webstore/detail/json-formatter/bcjindcccaagfpapjjmafapmmgkkhgoa?hl=en
BSD 3-Clause "New" or "Revised" License
3.76k stars 859 forks source link

Extension affects value type from sessionStorage #264

Open smitroshin opened 10 months ago

smitroshin commented 10 months ago

What is the current behavior?

image

TypeScript shows me the correct type of useSessionStorage state. But in reality type is "string".

console.log("🚀 ~ tabId:", tabId, typeof tabId);

# Console output: 🚀 ~ tabId: 1698999742580 string

Demo on CodeSandbox Test with extension on and off in incognito mode.

Note Originally, the issue was written for react-use library. But after, I found out that json-formatter makes that happened.

What is the expected behavior?

Type of useSessionStorage state should have type inherited from initialValue.

A little about versions: