react-day-picker icon indicating copy to clipboard operation
react-day-picker copied to clipboard

docs(translation): Fix wrong import on example

Open gonzalosalmeron opened this issue 6 months ago • 3 comments

Pull Request

Thank you for the great library! This PR fixes a naming conflict in the code examples.

What's Changed

  • Resolved variable naming conflicts in documentation examples when importing locales from both react-day-picker/locale and date-fns/locale.

Type of Change

  • [x] Documentation update

Additional Notes

This change improves clarity for developers using both libraries with localized calendars.

gonzalosalmeron avatar Jun 12 '25 10:06 gonzalosalmeron

Removing will hide from developers that the react-day-picker re-exports date-fns/locale for convenience.

this is not the first time we get this feedback... but the export has been added in #2474 . Is there something wrong on our side? 🤔

gpbl avatar Jun 17 '25 11:06 gpbl

Hi @gpbl @rodgobbi, thanks for the clarification! 🙏

I totally understand the intention of re-exporting date-fns/locale for convenience — however, after checking the published package, it seems the re-export isn’t actually working as expected.

I couldn’t find date-fns/locale included anywhere in the package (neither in the build output nor in the exports). I’ve attached some screenshots to show what I found — so even though the export was added in #2474 , it doesn’t appear to be accessible to consumers of the package right now.

Happy to help further or suggest a fix if needed! 🚀

image image image

gonzalosalmeron avatar Jul 14 '25 06:07 gonzalosalmeron

@gonzalosalmeron, what react-day-picker version are you using in the example? It should not have a dist/index.js file, and the file structure is not the same since v8.

rodgobbi avatar Jul 28 '25 19:07 rodgobbi