A lightweight higher-order component for adding 'add to calendar' functionality to custom React components. Current stable version is 1.0.10. It is unopinionated about styling and date libraries, allowing you to bring your own button/dropdown/modal components and handle date formatting with any library (e.g., Moment.js, date-fns). Releases are infrequent (last update 2019). Key differentiators: minimal bundle size compared to alternatives like react-add-to-calendar, no bundled date library, flexible component injection. Supported calendars: Google, Yahoo, Outlook, iCal/ICS download.
npm install react-add-to-calendar-hocNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Creates an AddToCalendar component by passing a custom button and dropdown. Renders the button; on click, shows the dropdown to select calendar service.
Ensure 'filename' is passed if custom ICS filename is desired.
Upgrade to React 16+ for full support.
Always include time and timezone offset (e.g., '2025-04-01T09:00:00-04:00').
Use desktop Outlook or rely on ICS download for Outlook.
Include polyfills for Object.values and handle URI encoding for older browsers.
Use `import AddToCalendarHOC from 'react-add-to-calendar-hoc'` (no curly braces).
Use v1.0.7+ or include a polyfill for Object.values.
Consider using ICS download (buttonProps.download = true) for mobile.