You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have run into a very damning issue with the current implementation of useData. It seems to scrub data from the user's returned json in certain circumstances. I've been unable to know the extent to which this happens however I can confirm a meta tag is always purged in dev mode and only initially purged in production mode, then eventually your meta tag returns after initial hydration is complete. I have an example repo of a minimum reproduction here and I have a production example of some of the issue here
In the production example, you'll notice that my data first comes in as a Date string and then is formatted into a toLocaleDateString(). This is because of the type purging initially and then once hydration is complete I am able to properly reconstruct the Date object and call .toLocaleDateString(). There are ways to get around this issue by simply making the transformation on the server side, but it would be nice to have control over my data and not have some of it randomly scrubbed, especially when I haven't been able to find all cases where this can happen.
The text was updated successfully, but these errors were encountered:
Brocktho
changed the title
useData hook and whatever method of hydrating data is currently implement is inadequate.
useData hook and whatever method of hydrating data is currently not adequately implemented.
Jul 1, 2023
I have run into a very damning issue with the current implementation of useData. It seems to scrub data from the user's returned json in certain circumstances. I've been unable to know the extent to which this happens however I can confirm a meta tag is always purged in dev mode and only initially purged in production mode, then eventually your meta tag returns after initial hydration is complete. I have an example repo of a minimum reproduction here and I have a production example of some of the issue here
In the production example, you'll notice that my data first comes in as a Date string and then is formatted into a toLocaleDateString(). This is because of the type purging initially and then once hydration is complete I am able to properly reconstruct the Date object and call .toLocaleDateString(). There are ways to get around this issue by simply making the transformation on the server side, but it would be nice to have control over my data and not have some of it randomly scrubbed, especially when I haven't been able to find all cases where this can happen.
The text was updated successfully, but these errors were encountered: