React Calendar is a highly customizable and internationalization-friendly date picker component for React applications. Currently stable at version 6.0.1, it receives frequent updates that include new features, bug fixes, and performance improvements. It leverages modern React features like the new JSX transform and is distributed exclusively as an ES module since version 6.0.0. Key differentiators include its robust TypeScript support, extensibility through props like `tileClassName` and `tileContent`, and recent adoption of npm trusted publishing and immutable releases for enhanced supply chain security, aiming to improve overall supply chain security and reliability for users.
npm install react-calendarVerified import paths — ran on the pinned version, not inferred.
Demonstrates a basic interactive calendar with state management for date selection, supporting both single date and range selection.
Use ES module import syntax (`import/export`) exclusively. For Jest, consider migrating to Vitest or configuring Jest for ESM support (e.g., using `esm-loader` or `transform`).
Ensure your build tools (e.g., Babel with `@babel/plugin-transform-react-jsx` or TypeScript with `jsx: react-jsx`) are configured to use the new JSX transform.
Remove any usage of `propTypes` with `react-calendar`. Migrate to TypeScript for static type checking or use a runtime validation library like Zod or Joi if runtime validation is necessary.
Review the documentation and update `calendarType` values to conform to `Intl.Locale.calendar` standards to ensure future compatibility.
Consider migrating your testing setup to Vitest, which has native ESM support. Alternatively, configure Jest to handle ESM modules, which often involves using experimental features or specific transformers.
Upgrade `react-calendar` to version 6.0.1 or newer, which includes a fix for this specific TypeError.
Change all instances of `const Calendar = require('react-calendar');` to `import Calendar from 'react-calendar';` and ensure your project's build environment supports ESM.Enable the automatic JSX runtime in your Babel configuration (e.g., `"plugins": [["@babel/plugin-transform-react-jsx", {"runtime": "automatic"}]]`) or TypeScript `tsconfig.json` (`"jsx": "react-jsx"`).Remove any `propTypes` definitions or checks related to `react-calendar`. For type safety, use TypeScript or a separate runtime validation library.