Fix undefined is not an object error in data-table-bazza-filters#62
Conversation
|
|
|
Important Review skippedBot user detected. To trigger a single review, invoke the You can disable this status message by setting the 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Join our Discord community 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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
|
Hey! 👋 I see one of the checks failed. I am on it! 🫡 |
|
I've fixed the failing check in PR #62 by updating the yarn.lock file. The build was failing because the lockfile was out of sync with the package dependencies, causing the error: "The lockfile would have been modified by this install, which is explicitly forbidden." I've pushed a commit that updates the yarn.lock file to match the current dependencies, which should resolve the build failure. 💻 View my work • React 👍 or 👎 |
Issue
PR #57 was experiencing an error:
undefined is not an object (evaluating 'n.length')in the data-table-bazza-filters.stories component.Fix
This PR adds proper null checks and defensive programming to prevent the error:
useDataTableFiltersto ensure we don't try to access properties of undefined objectscalculateFacetedCountsfunction to handle empty data arraysDataTableWithBazzaFilterscomponent to use optional chaining for accessing nested propertiesTesting
The changes ensure that the component can handle undefined or null values gracefully without throwing errors.
💻 View my work • About Codegen