Export useIsTooltipActive and useActiveTooltipCoordinate hooks hooks#6880
Export useIsTooltipActive and useActiveTooltipCoordinate hooks hooks#6880
Conversation
WalkthroughThe PR introduces two new public hooks ( Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested labels
Suggested reviewers
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 0
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/state/selectors/selectors.ts (1)
146-159: Fix the return type annotation to match the actual implementation.The return type is annotated as
Coordinate | undefined, but the implementation can returnPolarCoordinate. SincetooltipInteractionState.coordinateis typed asCoordinate | PolarCoordinate | undefined, and the nullish coalescing operator returns it unchanged when it's not null/undefined, the selector can return aPolarCoordinateat runtime despite the narrower type annotation.The return type should be
Coordinate | PolarCoordinate | undefinedto match the possible values fromtooltipInteractionState.coordinate.
🧹 Nitpick comments (2)
www/src/docs/api/index.ts (1)
74-75: Remove explicit.tsxfile extensions from imports.The imports include explicit
.tsxextensions which is non-standard for TypeScript module imports. Most bundlers and TypeScript configurations expect extension-less imports.Suggested fix
-import { useActiveTooltipCoordinateAPI } from './useActiveTooltipCoordinateAPI.tsx'; -import { useIsTooltipActiveAPI } from './useIsTooltipActiveAPI.tsx'; +import { useActiveTooltipCoordinateAPI } from './useActiveTooltipCoordinateAPI'; +import { useIsTooltipActiveAPI } from './useIsTooltipActiveAPI';src/hooks.ts (1)
137-157: Consider memoizing the returned coordinate object.The hook creates a new object reference on every call, which could trigger unnecessary re-renders for consumers who use this in dependency arrays or perform shallow equality checks. The explicit
{ x, y }extraction is correct for strippingPolarCoordinateproperties from the internal state.♻️ Optional: memoize the coordinate to preserve referential equality
+import { useMemo } from 'react'; + export const useActiveTooltipCoordinate = (): Coordinate | undefined => { const coordinate = useAppSelector(selectActiveTooltipCoordinate); - if (coordinate == null) { - return undefined; - } - return { - x: coordinate.x, - y: coordinate.y, - }; + return useMemo(() => { + if (coordinate == null) { + return undefined; + } + return { + x: coordinate.x, + y: coordinate.y, + }; + }, [coordinate?.x, coordinate?.y]); };
📜 Review details
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
www/test/__snapshots__/navigation.spec.tsx.snapis excluded by!**/*.snap
📒 Files selected for processing (14)
omnidoc/readProject.spec.tssrc/component/Tooltip.tsxsrc/hooks.tssrc/index.tssrc/state/selectors/selectors.tssrc/state/tooltipSlice.tssrc/synchronisation/useChartSynchronisation.tsxwww/src/docs/api/index.tswww/src/docs/api/useActiveTooltipCoordinateAPI.tsxwww/src/docs/api/useIsTooltipActiveAPI.tsxwww/src/docs/apiCates.tswww/src/docs/apiExamples/index.tsxwww/src/docs/apiExamples/useActiveTooltipCoordinate/index.tswww/src/docs/apiExamples/useIsTooltipActive/index.ts
🧰 Additional context used
📓 Path-based instructions (4)
**/*.{ts,tsx}
📄 CodeRabbit inference engine (CONTRIBUTING.md)
**/*.{ts,tsx}: Never useanytype (implicit or explicit) in TypeScript code
Preferunknownoveranyand refine the type in TypeScript
Type function parameters and return values explicitly in TypeScript, do not rely on implicit any or inference; exceptions are React components and trivial functions
Do not useastype assertions in TypeScript; the only exception isas constAll imports from
rechartsmust use the public API entry point (e.g.,import { TooltipIndex } from 'recharts'). Imports from internal paths likerecharts/types/*orrecharts/src/*are not allowed and will fail the linter.
Files:
src/index.tsomnidoc/readProject.spec.tswww/src/docs/apiExamples/index.tsxwww/src/docs/apiExamples/useIsTooltipActive/index.tswww/src/docs/api/useIsTooltipActiveAPI.tsxwww/src/docs/api/useActiveTooltipCoordinateAPI.tsxsrc/synchronisation/useChartSynchronisation.tsxwww/src/docs/apiExamples/useActiveTooltipCoordinate/index.tssrc/component/Tooltip.tsxsrc/state/tooltipSlice.tswww/src/docs/apiCates.tswww/src/docs/api/index.tssrc/state/selectors/selectors.tssrc/hooks.ts
**/*.{js,ts,tsx}
📄 CodeRabbit inference engine (CONTRIBUTING.md)
Ensure code lints by running
npm run lintand follows Airbnb's Style Guide
Files:
src/index.tsomnidoc/readProject.spec.tswww/src/docs/apiExamples/index.tsxwww/src/docs/apiExamples/useIsTooltipActive/index.tswww/src/docs/api/useIsTooltipActiveAPI.tsxwww/src/docs/api/useActiveTooltipCoordinateAPI.tsxsrc/synchronisation/useChartSynchronisation.tsxwww/src/docs/apiExamples/useActiveTooltipCoordinate/index.tssrc/component/Tooltip.tsxsrc/state/tooltipSlice.tswww/src/docs/apiCates.tswww/src/docs/api/index.tssrc/state/selectors/selectors.tssrc/hooks.ts
src/**/*.{ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
Do not hardcode any strings or formatting choices in library code; users should provide localized strings as desired
Files:
src/index.tssrc/synchronisation/useChartSynchronisation.tsxsrc/component/Tooltip.tsxsrc/state/tooltipSlice.tssrc/state/selectors/selectors.tssrc/hooks.ts
**/*.spec.{ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
When running unit tests, prefer to run a single test file using
npm run test -- path/to/TestFile.spec.tsxrather than running all tests withnpm testUnit tests should be placed in the
testdirectory, with some tests also allowed inwww/test. Test files follow the naming convention*.spec.tsx.
Files:
omnidoc/readProject.spec.ts
🧠 Learnings (12)
📓 Common learnings
Learnt from: PavelVanecek
Repo: recharts/recharts PR: 6669
File: www/src/docs/exampleComponents/ScatterChart/ScatterChartWithLabels.tsx:2-2
Timestamp: 2025-11-23T13:30:10.395Z
Learning: The `TooltipIndex` type from recharts is defined in `src/state/tooltipSlice.ts` but is not currently exported from the public API entry points. It should not be imported from `recharts/types/state/tooltipSlice` as this is an internal implementation path. An ESLint rule is needed to prevent regressions.
Learnt from: PavelVanecek
Repo: recharts/recharts PR: 6771
File: src/shape/Curve.tsx:39-40
Timestamp: 2025-12-14T13:58:58.361Z
Learning: In the recharts codebase, `useAppSelector` and hooks like `useChartLayout()` are designed to return `undefined` when used outside Redux Provider context, rather than throwing errors. This allows components like `Curve` that call these hooks to work standalone by falling back to prop values.
📚 Learning: 2025-11-23T13:30:10.395Z
Learnt from: PavelVanecek
Repo: recharts/recharts PR: 6669
File: www/src/docs/exampleComponents/ScatterChart/ScatterChartWithLabels.tsx:2-2
Timestamp: 2025-11-23T13:30:10.395Z
Learning: The `TooltipIndex` type from recharts is defined in `src/state/tooltipSlice.ts` but is not currently exported from the public API entry points. It should not be imported from `recharts/types/state/tooltipSlice` as this is an internal implementation path. An ESLint rule is needed to prevent regressions.
Applied to files:
src/index.tswww/src/docs/apiExamples/index.tsxwww/src/docs/apiExamples/useIsTooltipActive/index.tswww/src/docs/api/useIsTooltipActiveAPI.tsxwww/src/docs/api/useActiveTooltipCoordinateAPI.tsxsrc/synchronisation/useChartSynchronisation.tsxwww/src/docs/apiExamples/useActiveTooltipCoordinate/index.tssrc/component/Tooltip.tsxsrc/state/tooltipSlice.tswww/src/docs/apiCates.tswww/src/docs/api/index.tssrc/state/selectors/selectors.tssrc/hooks.ts
📚 Learning: 2025-12-26T15:59:11.254Z
Learnt from: CR
Repo: recharts/recharts PR: 0
File: DEVELOPING.md:0-0
Timestamp: 2025-12-26T15:59:11.254Z
Learning: Applies to **/*.{ts,tsx} : All imports from `recharts` must use the public API entry point (e.g., `import { TooltipIndex } from 'recharts'`). Imports from internal paths like `recharts/types/*` or `recharts/src/*` are not allowed and will fail the linter.
Applied to files:
src/index.tswww/src/docs/apiExamples/index.tsxwww/src/docs/apiExamples/useIsTooltipActive/index.tswww/src/docs/api/useIsTooltipActiveAPI.tsxwww/src/docs/api/useActiveTooltipCoordinateAPI.tsxsrc/synchronisation/useChartSynchronisation.tsxwww/src/docs/apiExamples/useActiveTooltipCoordinate/index.tssrc/component/Tooltip.tsxwww/src/docs/api/index.tssrc/hooks.ts
📚 Learning: 2025-11-25T01:23:08.250Z
Learnt from: CR
Repo: recharts/recharts PR: 0
File: test/README.md:0-0
Timestamp: 2025-11-25T01:23:08.250Z
Learning: Applies to test/**/*.{test,spec}.{ts,tsx} : When testing tooltips on hover, use `vi.runOnlyPendingTimers()` after each `userEvent.hover()` call or use the `showTooltip` helper function from `tooltipTestHelpers.ts` to account for requestAnimationFrame delays
Applied to files:
src/index.tswww/src/docs/apiExamples/index.tsxwww/src/docs/apiExamples/useIsTooltipActive/index.tswww/src/docs/api/useActiveTooltipCoordinateAPI.tsxwww/src/docs/apiExamples/useActiveTooltipCoordinate/index.tssrc/component/Tooltip.tsxwww/src/docs/api/index.tssrc/hooks.ts
📚 Learning: 2025-12-14T13:58:58.361Z
Learnt from: PavelVanecek
Repo: recharts/recharts PR: 6771
File: src/shape/Curve.tsx:39-40
Timestamp: 2025-12-14T13:58:58.361Z
Learning: In the recharts codebase, `useAppSelector` and hooks like `useChartLayout()` are designed to return `undefined` when used outside Redux Provider context, rather than throwing errors. This allows components like `Curve` that call these hooks to work standalone by falling back to prop values.
Applied to files:
src/index.tswww/src/docs/api/useIsTooltipActiveAPI.tsxwww/src/docs/api/useActiveTooltipCoordinateAPI.tsxsrc/hooks.ts
📚 Learning: 2025-12-26T15:59:11.254Z
Learnt from: CR
Repo: recharts/recharts PR: 0
File: DEVELOPING.md:0-0
Timestamp: 2025-12-26T15:59:11.254Z
Learning: Applies to test-vr/**/*.spec.ts : Visual regression tests should follow the naming convention `*.spec.ts` and be placed in the `test-vr` directory. When updating snapshots, new files created in `test-vr/__snapshots__` should be committed to the repository.
Applied to files:
omnidoc/readProject.spec.ts
📚 Learning: 2025-11-25T01:23:08.250Z
Learnt from: CR
Repo: recharts/recharts PR: 0
File: test/README.md:0-0
Timestamp: 2025-11-25T01:23:08.250Z
Learning: Applies to test/**/*.{test,spec}.{ts,tsx} : Verify the number of selector calls using the spy object from `createSelectorTestCase` to spot unnecessary re-renders and improve performance
Applied to files:
omnidoc/readProject.spec.ts
📚 Learning: 2025-12-16T08:12:13.355Z
Learnt from: PavelVanecek
Repo: recharts/recharts PR: 6783
File: test/util/ChartUtils.spec.tsx:15-16
Timestamp: 2025-12-16T08:12:13.355Z
Learning: In the recharts codebase, files in the `test` folder are allowed to import from internal paths (e.g., `../../src/state/cartesianAxisSlice`) and do not need to use the public API entry point (`src/index.ts`). The public API import restriction applies only to non-test code.
Applied to files:
www/src/docs/apiExamples/index.tsxwww/src/docs/apiExamples/useIsTooltipActive/index.tswww/src/docs/api/useActiveTooltipCoordinateAPI.tsxwww/src/docs/apiExamples/useActiveTooltipCoordinate/index.tssrc/component/Tooltip.tsxwww/src/docs/api/index.tssrc/hooks.ts
📚 Learning: 2026-01-06T22:33:55.414Z
Learnt from: PavelVanecek
Repo: recharts/recharts PR: 6855
File: www/src/docs/api/AreaChartAPI.tsx:422-438
Timestamp: 2026-01-06T22:33:55.414Z
Learning: In Recharts v3, components can render inside any chart type as long as the parent provides the necessary cartesian context (e.g., AreaChart, BarChart, ComposedChart, LineChart, ScatterChart). This means API/tests describing cross-chart compatibility should reflect that Funnel-like components can render under multiple chart parents when Cartesian context is available. When reviewing code or docs, verify that the parent chart supplies the required context and that embedding is intentional for all relevant chart types; update tests/docs to avoid assuming stricter parent-child limitations from Recharts v2.
Applied to files:
www/src/docs/api/useIsTooltipActiveAPI.tsxwww/src/docs/api/useActiveTooltipCoordinateAPI.tsx
📚 Learning: 2026-01-11T06:13:55.304Z
Learnt from: PavelVanecek
Repo: recharts/recharts PR: 6869
File: www/src/docs/api/useXAxisDomainAPI.tsx:6-20
Timestamp: 2026-01-11T06:13:55.304Z
Learning: In API documentation for hooks (e.g., useXAxisDomainAPI), it's acceptable to describe a parameter like xAxisId using both its literal value (0) and the constant name (defaultAxisId). The description can reference the literal to aid readability, while the defaultVal or equivalent should point to the constant name to aid maintainability. Ensure consistency across similar docs and clearly explain both perspectives for developers using the API.
Applied to files:
www/src/docs/api/useIsTooltipActiveAPI.tsxwww/src/docs/api/useActiveTooltipCoordinateAPI.tsx
📚 Learning: 2025-12-14T13:58:49.197Z
Learnt from: PavelVanecek
Repo: recharts/recharts PR: 6771
File: src/shape/Curve.tsx:39-40
Timestamp: 2025-12-14T13:58:49.197Z
Learning: In the recharts codebase, hooks like useAppSelector and other hooks (e.g., useChartLayout()) return undefined when used outside Redux Provider context, instead of throwing. This enables components that call these hooks, such as Curve, to operate in standalone mode by falling back to prop values. During code reviews, ensure TSX files gracefully handle undefined results from hooks and implement fallbacks (e.g., via default props or explicit prop-based values) rather than assuming the hook is always within Provider.
Applied to files:
src/synchronisation/useChartSynchronisation.tsxsrc/component/Tooltip.tsx
📚 Learning: 2026-01-11T06:14:03.412Z
Learnt from: PavelVanecek
Repo: recharts/recharts PR: 6869
File: www/src/docs/api/useXAxisDomainAPI.tsx:6-20
Timestamp: 2026-01-11T06:14:03.412Z
Learning: In Recharts, the constant `defaultAxisId` equals `0`. When documenting hook parameters like `xAxisId` in API docs, it's acceptable for the description to reference the literal value (0) while the `defaultVal` field references the constant name ('defaultAxisId'), as both perspectives are useful for users.
Applied to files:
src/hooks.ts
🧬 Code graph analysis (11)
www/src/docs/apiExamples/index.tsx (2)
www/src/docs/apiExamples/useIsTooltipActive/index.ts (1)
useIsTooltipActiveApiExamples(5-13)www/src/docs/apiExamples/useActiveTooltipCoordinate/index.ts (1)
useActiveTooltipCoordinateApiExamples(5-13)
www/src/docs/apiExamples/useIsTooltipActive/index.ts (1)
www/src/docs/exampleComponents/types.ts (1)
ChartExample(3-25)
www/src/docs/api/useIsTooltipActiveAPI.tsx (1)
www/src/docs/api/types.ts (1)
ApiDoc(21-31)
www/src/docs/api/useActiveTooltipCoordinateAPI.tsx (1)
www/src/docs/api/types.ts (1)
ApiDoc(21-31)
src/synchronisation/useChartSynchronisation.tsx (1)
src/index.ts (1)
Coordinate(138-138)
www/src/docs/apiExamples/useActiveTooltipCoordinate/index.ts (1)
www/src/docs/exampleComponents/types.ts (1)
ChartExample(3-25)
src/component/Tooltip.tsx (2)
src/util/types.ts (1)
Coordinate(128-131)src/state/hooks.ts (1)
useAppSelector(40-62)
src/state/tooltipSlice.ts (2)
src/index.ts (1)
Coordinate(138-138)src/util/types.ts (1)
Coordinate(128-131)
www/src/docs/api/index.ts (2)
www/src/docs/api/useIsTooltipActiveAPI.tsx (1)
useIsTooltipActiveAPI(4-30)www/src/docs/api/useActiveTooltipCoordinateAPI.tsx (1)
useActiveTooltipCoordinateAPI(4-31)
src/state/selectors/selectors.ts (3)
src/index.ts (1)
Coordinate(138-138)src/util/types.ts (1)
Coordinate(128-131)src/state/tooltipSlice.ts (1)
TooltipInteractionState(130-174)
src/hooks.ts (2)
src/state/selectors/tooltipSelectors.ts (2)
selectIsTooltipActive(493-496)selectActiveTooltipCoordinate(479-491)src/util/types.ts (1)
Coordinate(128-131)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: Build, Test, Pack
- GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (14)
src/component/Tooltip.tsx (1)
14-14: LGTM! Type narrowing fromCoordinate | PolarCoordinatetoCoordinateis consistent with the PR objectives.The removal of
PolarCoordinatefrom the import and the narrowed type annotation forcoordinatealigns with the broader changes in this PR to simplify the public API. TheCoordinatetype withxandyproperties is sufficient for the tooltip cursor coordinates being exposed via the new hooks.Also applies to: 332-334
omnidoc/readProject.spec.ts (1)
44-50: LGTM! Test refactoring improves maintainability.Replacing the inline snapshot with targeted assertions makes this test less brittle. As the public API expands (like with the new tooltip hooks in this PR), the test won't need constant snapshot updates while still verifying the core behavior of symbol kind filtering.
www/src/docs/apiCates.ts (1)
27-28: LGTM! New hooks properly categorized.The placement of
useIsTooltipActiveanduseActiveTooltipCoordinatein thegeneral-componentscategory is appropriate, grouping them with other tooltip-related items and hooks.www/src/docs/apiExamples/index.tsx (1)
35-36: LGTM! API examples properly registered.The imports and map entries follow the established pattern in this file. The hook names used as keys are consistent with their usage in
apiCates.tsand the API documentation.Also applies to: 64-65
www/src/docs/api/useIsTooltipActiveAPI.tsx (1)
4-30: Update documentation version claim — Recharts v3.7 does not exist.Line 18 claims the hook is "Available since Recharts 3.7", but v3.7 has not been released. The latest Recharts version is v3.6.0, and this hook is not present in that release. Since the hook was only recently added to the codebase and is not yet in any published version, the version reference should be removed or updated once the actual release version is finalized. Until then, either remove the version statement or mark it as "Available in upcoming release".
The API documentation structure and descriptions are otherwise accurate.
⛔ Skipped due to learnings
Learnt from: PavelVanecek Repo: recharts/recharts PR: 6669 File: www/src/docs/exampleComponents/ScatterChart/ScatterChartWithLabels.tsx:2-2 Timestamp: 2025-11-23T13:30:10.395Z Learning: The `TooltipIndex` type from recharts is defined in `src/state/tooltipSlice.ts` but is not currently exported from the public API entry points. It should not be imported from `recharts/types/state/tooltipSlice` as this is an internal implementation path. An ESLint rule is needed to prevent regressions.Learnt from: CR Repo: recharts/recharts PR: 0 File: DEVELOPING.md:0-0 Timestamp: 2025-12-26T15:59:11.254Z Learning: Applies to **/*.{ts,tsx} : All imports from `recharts` must use the public API entry point (e.g., `import { TooltipIndex } from 'recharts'`). Imports from internal paths like `recharts/types/*` or `recharts/src/*` are not allowed and will fail the linter.Learnt from: PavelVanecek Repo: recharts/recharts PR: 6869 File: www/src/docs/api/useXAxisDomainAPI.tsx:6-20 Timestamp: 2026-01-11T06:14:03.412Z Learning: In Recharts, the constant `defaultAxisId` equals `0`. When documenting hook parameters like `xAxisId` in API docs, it's acceptable for the description to reference the literal value (0) while the `defaultVal` field references the constant name ('defaultAxisId'), as both perspectives are useful for users.Learnt from: PavelVanecek Repo: recharts/recharts PR: 6659 File: www/src/components/GuideView/Performance/index.tsx:232-250 Timestamp: 2025-11-19T14:08:01.728Z Learning: In Recharts version 3.4.2, object-as-prop optimizations were introduced to reduce unnecessary re-renders when new object references are passed as props. This affects the recommendation for the `react-perf/jsx-no-new-object-as-prop` ESLint rule.Learnt from: CR Repo: recharts/recharts PR: 0 File: test/README.md:0-0 Timestamp: 2025-11-25T01:23:08.250Z Learning: Applies to test/**/*.{test,spec}.{ts,tsx} : When testing tooltips on hover, use `vi.runOnlyPendingTimers()` after each `userEvent.hover()` call or use the `showTooltip` helper function from `tooltipTestHelpers.ts` to account for requestAnimationFrame delayswww/src/docs/apiExamples/useIsTooltipActive/index.ts (1)
1-13: LGTM!The API examples file is correctly structured with proper typing and follows the established pattern for chart examples. The
ReadonlyArray<ChartExample>type ensures immutability, and all required fields from theChartExampletype are provided.www/src/docs/apiExamples/useActiveTooltipCoordinate/index.ts (1)
1-13: LGTM!The file follows the same well-structured pattern as the
useIsTooltipActiveexamples, with consistent typing and proper configuration for the devtools tab.www/src/docs/api/index.ts (1)
110-113: LGTM!The new API documentation entries are well-organized, grouping all tooltip-related hooks together (
useIsTooltipActive,useActiveTooltipDataPoints,useActiveTooltipLabel,useActiveTooltipCoordinate).www/src/docs/api/useActiveTooltipCoordinateAPI.tsx (1)
1-31: LGTM!The API documentation is well-structured and provides clear information about the hook's behavior, return type, and usage constraints. The return type
Coordinate | undefinedcorrectly matches the narrowed type in the selector implementation.src/state/selectors/selectors.ts (1)
18-25: LGTM on import retention.The
PolarCoordinateimport is correctly retained as it's still used internally incombineActivePolarProps(line 254), even though it's been removed from the public API surface ofselectActiveCoordinate.src/state/tooltipSlice.ts (1)
83-86: Type narrowing is appropriate for public API simplification.The narrowing of
activeCoordinatefromCoordinate | PolarCoordinate | undefinedtoCoordinate | undefinedsimplifies the public API. Internal state (TooltipInteractionState.coordinateat line 173) still retainsPolarCoordinatesupport, allowing internal flexibility while presenting a cleaner interface to consumers.src/synchronisation/useChartSynchronisation.tsx (1)
9-9: Type alignment with the broader coordinate type narrowing.The import change and parameter type update from
ChartCoordinatetoCoordinateare consistent with the type narrowing applied across the tooltip system in this PR.Also applies to: 197-204
src/index.ts (1)
155-164: Public API exports correctly expose the new tooltip hooks.The new hooks
useIsTooltipActiveanduseActiveTooltipCoordinateare properly exported alongside existing hooks, fulfilling the linked issue #6299's request for hook-based access to tooltip state.src/hooks.ts (1)
122-135: Well-documented hook with appropriate defensive coding.The
?? falsefallback correctly handles the case whenuseAppSelectorreturnsundefinedoutside Redux Provider context, which aligns with the established pattern in this codebase (based on learnings).
Codecov Report❌ Patch coverage is
Additional details and impacted files☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Staging Deployment Details
These deployments will remain available for 30 days. To update snapshots: Comment |
Bundle ReportChanges will increase total bundle size by 3.55kB (0.13%) ⬆️. This is within the configured threshold ✅ Detailed changes
Affected Assets, Files, and Routes:view changes for bundle: recharts/bundle-es6Assets Changed:
view changes for bundle: recharts/bundle-cjsAssets Changed:
view changes for bundle: recharts/bundle-umdAssets Changed:
|
| * Recharts only allows one Tooltip per chart, so this hook does not take any parameters. | ||
| * Weird things may happen if you have multiple Tooltip components in the same chart so please don't do that. |
There was a problem hiding this comment.
I mean technically we allow this in 3.x?
There was a problem hiding this comment.
The state internally only stores a single instance so the tooltips will overwrite each other randomly. So technically it's possible but also not supported.
Related Issue
Closes #6299
Types of changes
Checklist:
Summary by CodeRabbit
New Features
useIsTooltipActive()to check tooltip activation state anduseActiveTooltipCoordinate()to access tooltip coordinates.Documentation
✏️ Tip: You can customize this high-level summary in your review settings.