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
it is confused when I just want to set a cookie but getting the wrong value. I think it should not execute JSON.parse by default. Or keep it simple and just leave this transform function to others.
The text was updated successfully, but these errors were encountered:
The problem here is that javascript think it is a number but it is a string. A lot of people are having the same kind of problem.
I think having an automatic stringify / parse is still nice but it should be kept only on objects. The check can be as simple as if the cookie value is starting with a { or [, we're parsing it (unless it throws of course).
https://github.com/eXon/react-cookie/blob/master/index.js#L42
By default, it will execute
JSON.parse
to parse the value. the problem is here. for example.it is confused when I just want to set a cookie but getting the wrong value. I think it should not execute
JSON.parse
by default. Or keep it simple and just leave this transform function to others.The text was updated successfully, but these errors were encountered: