Error using JSON.parse(x.y) || Using capacitor and Ionic+React

when i try parse a JSON stringify return a error, this is de code.

  async componentDidMount(){
    const Data = await Storage.get({ key: "Login" })
   const Json = JSON.parse( Data.value );
  }

Argument of type ‘string | null’ is not assignable to parameter of type ‘string’.
Type ‘null’ is not assignable to type ‘string’.ts(2345)

While the error message is telling you what is wrong (the official signature for JSON.parse does not want you to feed it null), the larger issue is that it’s rather unusual for you to be needing to explicitly call JSON.parse at all (or JSON.stringify) - all that should be taken care of you by Ionic Storage and its drivers.

In Capacitor documentation the method for save in Storage is

Storage.set({ key: "data", value: { JSON.stringify... }  })

for see de storage value a need JSON.parse(), en Capacitor documentation dont exist other method for this, yu can help me with this? :frowning:

the solution is use that JSON.parse(${Data.value})