0

This is an image what exactly, i am facing the problem "type 'string null' is not assignable to type 'string'. typescript"

enter image description here

2 Answers 2

0

add '?' after type localItem:string?;

Sign up to request clarification or add additional context in comments.

1 Comment

localItem:string?; this is not working instead of that i'm adding this localItem: string | null;
0

I simply add This =>

localItem: string | null;

and finally it's working!

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.