Answers for "Argument of type 'string | null' is not assignable to parameter of type 'string'. Type 'null' is not assignable to type 'string'"

8

Argument of type 'string | null' is not assignable to parameter of type 'string'. Type 'null' is not assignable to type 'string'

this.currentUser = JSON.parse(localStorage.getItem('currentUser') || '{}');
Posted by: Guest on December-18-2020

Code answers related to "Argument of type 'string | null' is not assignable to parameter of type 'string'. Type 'null' is not assignable to type 'string'"

Code answers related to "TypeScript"

Browse Popular Code Answers by Language