Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

useData hook and whatever method of hydrating data is currently not adequately implemented. #561

Open
Brocktho opened this issue Jul 1, 2023 · 0 comments

Comments

@Brocktho
Copy link
Contributor

Brocktho commented 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.

@Brocktho 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant