Dingify
Dingify copied to clipboard
Bug: Hydration Error on Dashboard Page
Describe the bug
When you refresh the site you can see that we have a hydration error. This is probably the EventDetailsTable component.
Picture under is the error.
Steps to reproduce
- Go to /dashboard
- Refresh the page
- See error on left corner
Expected Behavior
The page should refresh without any errors.
The reason we are seeing this is due to the format of the date being different from the server and the client side. One way to fix it seems to be using a library like date-fns to format the date according in the EventsDashboardDetails.tsx file.
{format(new Date(event?.createdAt), "P")}
But the above method will format the date according to only a single format globally. If we want to change the region, then we might have to dynamically collect the locale and then convert it to that format I think so..