MessageProviderProps.onError property
What to do on errors; most often called if a message is not found.
-
"silent"
: Ignore the error; use the message’s id as the replacement message. -
"error"
: Throw the error. -
"warn"
(default): Print a warning in the console and use the message’s id as the replacement message. -
(error) => any
: A custom function that is called with anError
object withcode: string
andpath: string[]
fields set. The return falue is used as the replacement message.
Signature:
onError?: 'error' | 'silent' | 'warn' | ((error: MessageError) => unknown);