Skip to content

Updating a value that is in object format #3232

Answered by johnrom
mattbesedick asked this question in Q&A
Discussion options

You must be logged in to vote

The short answer is you would generally only save one version from which all other versions could be recreated. For a date this might be an ISO formatted date, any string which could be parsed with date-fns, or an actual Date object. If the user can type in your input, though, you'll want to store a text based date-like string even if it isn't a valid date, to handle the user typing transient values.

However, to help with your specific use case, it may be beneficial to recreate in a codesandbox and link it here.

Replies: 1 comment 6 replies

Comment options

You must be logged in to vote
6 replies
@johnrom
Comment options

johnrom Jun 7, 2021
Collaborator

@mattbesedick
Comment options

@johnrom
Comment options

johnrom Jun 8, 2021
Collaborator

@mattbesedick
Comment options

@johnrom
Comment options

johnrom Jun 8, 2021
Collaborator

Answer selected by mattbesedick
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants