prismicio / prismic-react

React components and hooks to fetch and present Prismic content
https://prismic.io/docs/technologies/homepage-reactjs
Apache License 2.0
154 stars 40 forks source link

Is there an equivalent to prismic-reactjs' Date component? #136

Closed dungle-scrubs closed 2 years ago

dungle-scrubs commented 2 years ago

After switching from prismic-reactjs to @prismicio/react, I don't yet see a way to render a date field. Is this an available feature?

angeloashmore commented 2 years ago

Hey @dungle-scrubs,

The Date export from prismic-reactjs was just a re-export of a helper from @prismicio/helpers. Since it is not a React-specific helper, it was removed in the new @prismicio/react.

You can see more details on migrating prismic-reactjs's Date() to @prismicio/helpers's asDate() here: https://prismic.io/docs/technologies/prismic-react-v2-migration-guide#replace-date-with-asdate

If you are upgrading your project from prismic-reactjs to @prismicio/react, I recommend going through the full Migration Guide here: https://prismic.io/docs/technologies/prismic-react-v2-migration-guide

I'm going to close this issue, but please feel free to comment here if you have any other questions. Thanks! 🙂