Encountering an error in the app stating that a non-serializable value has been detected in the state, particularly related to the date format from the Calendar component in PrimeReact. Researching the issue suggests that the problem lies in the property handling data in the app having an object type, whereas for it to be serializable, it should be a string. Is this understanding correct?
Having difficulty in converting this property to a string as the value in CalendarProps from PrimeReact, where I select the date, is typed as Date. Is it feasible to change this format to a string?
The TypeScript error message I received is as follows:
(property) value?: Date | Date[] | undefined
No overload matches this call.
Overload 1 of 2, '(props: CalendarProps | Readonly<CalendarProps>): Calendar', gave the following error.
Type 'string' is not assignable to type 'Date | Date[] | undefined'.
Overload 2 of 2, '(props: CalendarProps, context: any): Calendar', gave the following error.
Type 'string' is not assignable to type 'Date | Date[] | undefined'.ts(2769)
Discovered that it is feasible to disable the serializableCheck, but would prefer to explore if there is an alternative way to resolve this error first.
const customizedMiddleware = getDefaultMiddleware({
serializableCheck: false
})
Thank you