Lib throws an error on identifier set to `undefined`
Hi!
When I want to unsubscribe a user to batch when he wants to logout, I try to set the identifier to undefined as typed by the library (the code calls the method clearUserId).
import { Batch, BatchUser } from "@bam.tech/react-native-batch";
class Notification {
public constructor() {
Batch.start();
}
public setUserId(id?: string): void {
BatchUser.editor()
.setIdentifier(id)
.save();
}
public clearUserId(): void {
this.setUserId();
}
}
export const NotificationService = new Notification();
throws this error

When I set the identifier to null (as the doc in Batch seems to define it), it works like a charm. But TypeScript is not happy : Argument of type 'null' is not assignable to parameter of type 'string | undefined'.
Does the .d.ts file need to be updated?
Thank you.
Same issue on Android.
It's due to ReadableNativeMap#getType that throw an NoSuchKeyException if value is undefined.
To fix this issue, this lib should check key existence (with hasKey) before using getType, or add a try/catch block on NoSuchKeyException and define as null in these case.
Or disallow using undefined & allow null in TS declaration.