I'm trying to delete a key of my react-native state Map object.
const [errors, setErrors] = useState<Map<string, string>>(null);
let copy: Map<string,string> = {...errors}
copy["a"] = "a";
setErrors(copy);
let copy2: Map<string,string> = {...errors};
copy2.delete("a"); //Got error here
setErrors(copy2);
But i've this error :
copy2.delete is not a function (In 'copy2.delete("a"),'copy2.delete' is undefined)
How to handle that ?