Skip to content

Fix react-day-picker v9 compatibility by removing getDefaultClassNames#114

Merged
jaruesink merged 2 commits intomainfrom
codegen-bot/fix-react-day-picker-v9-compatibility-1754197741
Aug 3, 2025
Merged

Fix react-day-picker v9 compatibility by removing getDefaultClassNames#114
jaruesink merged 2 commits intomainfrom
codegen-bot/fix-react-day-picker-v9-compatibility-1754197741

Conversation

@codegen-sh
Copy link
Copy Markdown
Contributor

@codegen-sh codegen-sh Bot commented Aug 3, 2025

Problem

The build was failing with the following error when using @lambdacurry/forms v0.19.0:

import { getDefaultClassNames as p, DayPicker as h } from "react-day-picker";
// ^^^^^^^^^^^^^^^^^^^^^^^^
// This is not exported by react-day-picker

This is because getDefaultClassNames was removed in react-day-picker v9, but the calendar component was still trying to import and use it.

Solution

  • Removed getDefaultClassNames import from react-day-picker
  • Updated Calendar component to use custom class names directly without merging with default classes
  • Updated CalendarDayButton component to remove defaultClassNames usage
  • Maintained existing styling and functionality

Changes Made

  • packages/components/src/ui/calendar.tsx:
    • Removed getDefaultClassNames from imports
    • Removed const defaultClassNames = getDefaultClassNames() calls
    • Updated all classNames properties to use direct class strings instead of merging with defaultClassNames
    • Preserved all existing styling and behavior

Testing

✅ Build passes successfully (yarn build in packages/components)
✅ Calendar component compiles without errors
✅ All existing styling is preserved

Compatibility

This fix ensures compatibility with:

  • ✅ react-day-picker v9.7.0 (current version)
  • ✅ Maintains backward compatibility with existing component usage
  • ✅ No breaking changes to the public API

Resolves the build error reported by Jake Ruesink for projects using @lambdacurry/forms v0.19.0.


💻 View my workAbout Codegen
⛔ Remove Codegen from PR🚫 Ban action checks

Summary by CodeRabbit

  • Style

    • Updated calendar component styling by replacing default class names with explicit, custom class strings for all calendar elements.
  • Chores

    • Incremented the package version from 0.19.0 to 0.19.1.

…tibility

- Remove getDefaultClassNames import which was removed in react-day-picker v9
- Update Calendar component to use custom class names directly without merging with default classes
- Update CalendarDayButton component to remove defaultClassNames usage
- Maintains existing styling while ensuring compatibility with react-day-picker v9.7.0

Fixes build error: 'getDefaultClassNames' is not exported by react-day-picker
@bolt-new-by-stackblitz
Copy link
Copy Markdown

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Aug 3, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

The package version for packages/components was incremented from 0.19.0 to 0.19.1. In the calendar.tsx file, all usage of getDefaultClassNames from react-day-picker and related merging logic were removed. All DayPicker class names are now defined explicitly as string literals, with no changes to exported component interfaces.

Changes

Cohort / File(s) Change Summary
Version Bump
packages/components/package.json
Incremented the package version from 0.19.0 to 0.19.1. No other modifications to dependencies, scripts, or configuration.
Calendar Class Name Refactor
packages/components/src/ui/calendar.tsx
Removed import and usage of getDefaultClassNames from react-day-picker. Eliminated merging of default and custom class names; instead, assigned all classNames properties as explicit string literals in the DayPicker component. Adjusted CalendarDayButton to use only custom class strings. No changes to exported component signatures.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~7 minutes

Poem

A hop and a skip, a version hops high,
Calendar’s coat now catches the eye.
No more defaults from the picker’s den,
Just crisp, clear classes—pure rabbit zen!
With a twitch of the nose, and a code review done,
0.19.1—let’s hop in the sun!
🐇✨

Note

⚡️ Unit Test Generation is now available in beta!

Learn more here, or try it out under "Finishing Touches" below.


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f96eec7 and 50eb086.

⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (2)
  • packages/components/package.json (1 hunks)
  • packages/components/src/ui/calendar.tsx (2 hunks)
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch codegen-bot/fix-react-day-picker-v9-compatibility-1754197741

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Aug 3, 2025

📝 Storybook Preview: View Storybook

This preview will be updated automatically when you push new changes to this PR.

Note: The preview will be available after the workflow completes and the PR is approved for deployment.

@jaruesink
Copy link
Copy Markdown
Contributor

jaruesink commented Aug 3, 2025

@codegen-sh now let's bump the patch version with npm for the components package with a summary message of the change we made. do not publish that will happen in the pipeline, let's also run yarn install and make sure our yarn lock is up to date and just push back up

On it! I'll bump the patch version, update yarn lock, and push the changes 🚀

💻 View my work🛑 Stop

- Bump @lambdacurry/forms from 0.19.0 to 0.19.1
- Update yarn.lock with latest dependencies
- Version bump includes fix for react-day-picker v9 compatibility
@codegen-sh
Copy link
Copy Markdown
Contributor Author

codegen-sh Bot commented Aug 3, 2025

✅ Done! I've successfully:

  1. Bumped the patch version from 0.19.0 to 0.19.1 using npm with the commit message "fix: remove getDefaultClassNames for react-day-picker v9 compatibility"
  2. Updated yarn.lock with yarn install to ensure all dependencies are up to date
  3. Pushed the changes back to the PR

🔄 View Updated PR #114 on Github 🔄

The PR now includes both the fix and the version bump. The pipeline can handle publishing when you're ready! 🚀

💻 View my work🛑 Stop • React 👍 or 👎

@jaruesink jaruesink marked this pull request as ready for review August 3, 2025 05:16
@jaruesink jaruesink merged commit a581d43 into main Aug 3, 2025
4 of 5 checks passed
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

Successfully merging this pull request may close these issues.

1 participant