Skip to content

[uplift] fix: published declaration type errors in create-container and errorbar - #3164

Merged
ryan-roemer merged 2 commits into
mainfrom
fix/uplift-declaration-errors
Nov 12, 2026
Merged

ryan-roemer merged 2 commits into
mainfrom
fix/uplift-declaration-errors

Conversation

@ryan-roemer

@ryan-roemer ryan-roemer commented Nov 10, 2026 •

Copy link
Copy Markdown
Member

Item 3 of the types batch (#3093). Empties pack:check's ALLOWED_DECLARATION_ERRORS.

  • createContainer / makeCreateContainerFunction: explicit return types (16 TS2344 errors gone); same props; declaration goes from ~400 lines to ~40
  • ErrorBar: props are ErrorBarProps instead of any (the 2022 typeof ErrorBar.default reference made them any; TS2339 gone)
    • Stricter for consumers: undeclared or wrongly typed props now fail to type-check. Patch per semver-ts ("type bugs in a patch release"). Real-world uses found on GitHub (Metaculus, victory-native) already type props as ErrorBarProps
    • One test updated to Number(index), matching the other primitives' tests
  • getTicks: return type written out as number[] | string[] | Date[]. Adds Date[] (returned for date tickValues, missing from the inferred type) and keeps declaration order from flipping between builds. Also widens VictoryAxis's inferred ticks. New test for date tickValues
  • Declarations diffed before/after: only create-container, error-bar, victory-core's victory-util/axis and victory-axis (.d.mts/.d.cts) changed
  • Patch changeset: victory-axis, victory-core, victory-create-container, victory-errorbar

@vercel

vercel Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
victory Ready Ready Preview Nov 10, 2026 5:33pm UTC

Request Review

@ryan-roemer
ryan-roemer requested a lite review from Copilot November 10, 2026 17:23
@changeset-bot

changeset-bot Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 15565a4

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 29 packages
Name Type
victory-axis Patch
victory-core Patch
victory-create-container Patch
victory-errorbar Patch
victory-chart Patch
victory Patch
victory-area Patch
victory-bar Patch
victory-box-plot Patch
victory-brush-container Patch
victory-brush-line Patch
victory-candlestick Patch
victory-canvas Patch
victory-cursor-container Patch
victory-group Patch
victory-histogram Patch
victory-legend Patch
victory-line Patch
victory-pie Patch
victory-polar-axis Patch
victory-scatter Patch
victory-selection-container Patch
victory-shared-events Patch
victory-stack Patch
victory-tooltip Patch
victory-voronoi-container Patch
victory-voronoi Patch
victory-zoom-container Patch
victory-vendor Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

An active moderate finding remains because getTickArray can return Date[] for supported time-axis tick values while its declared return type excludes dates, leaving the public API type incorrect.

1 open issue
What changed in this PR

This pull request fixes published TypeScript declaration issues in container creation and the ErrorBar primitive, removes the corresponding declaration-error allowlist entries, and documents patch releases.

Changes:

  • Adds explicit return types to createContainer, makeCreateContainerFunction, and getTicks.
  • Types ErrorBar with ErrorBarProps and updates its accessibility test callback.
  • Removes resolved declaration-error exceptions from pack:check.
  • Adds a changeset for the affected packages.
File Description
scripts/​pack-check.mjs Removes the resolved declaration-error allowlist entries.
packages/​victory-errorbar/​src/​victory-errorbars.test.tsx Updates the accessibility test callback to convert its index to a number.
packages/​victory-errorbar/​src/​error-bar.tsx Replaces the inferred any props type with ErrorBarProps.
packages/​victory-create-container/​src/​create-container.tsx Adds explicit component and return types for container composition.
packages/​victory-core/​src/​victory-util/​axis.tsx Adds an explicit return annotation to getTicks.
.changeset/​declaration-errors.md Documents the published typing fixes and patch releases for the affected packages.

Review effort: Lite

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The review identifies no active issues, with the declaration errors addressed across the affected utilities and corresponding allowlist entries removed.

No open issues 🎉

1 resolved since last review

Review effort: Lite

@ryan-roemer
ryan-roemer merged commit 1e3997f into main Nov 12, 2026
9 checks passed
@ryan-roemer
ryan-roemer deleted the fix/uplift-declaration-errors branch November 12, 2026 17:56
@github-actions github-actions Bot mentioned this pull request Nov 12, 2026
@ryan-roemer ryan-roemer mentioned this pull request Nov 12, 2026
ryan-roemer pushed a commit that referenced this pull request Nov 12, 2026
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and the packages will
be published to npm automatically. If you're not ready to do a release
yet, that's fine, whenever you add more changesets to main, this PR will
be updated.


# Releases
## victory-core@38.1.0

### Minor Changes

- [#3166](#3166)
[`c47d8ca`](c47d8ca)
- The primitives `Circle`, `Line`, `Path`, `Rect`, `Text` and `TSpan`
accept their element's SVG attributes in TypeScript, such as `<Line
x1={25} y1={270} />`, `<Path d="..." />` and `<Circle cx={1} cy={2}
r={3} />`
([#3122](#3122)). These
worked at runtime but failed to type-check. Where a Victory prop shares
a name with an SVG attribute (`origin`, `role`, `style`, `id`,
`tabIndex`, `rx`, ...), Victory's type is kept; `name`, which the
primitives don't write to the element, stays out.
`VictoryPrimitiveShapeProps` takes an optional element type
(`VictoryPrimitiveShapeProps<SVGLineElement>`). New exported types:
`TSpanProps` (the props of `TSpan`) and `VictoryPrimitiveSvgProps`.

### Patch Changes

- [#3165](#3165)
[`3ba0908`](3ba0908)
- `DataGetterPropType` (the type of `x`, `y`, `y0` and `sortKey`)
accepts accessors that return a `Date`, such as `x={(d) => new
Date(d.date)}`. These worked at runtime but failed to type-check
(TS2769).

- [#3164](#3164)
[`1e3997f`](1e3997f)
- Fix type errors in published declarations under `skipLibCheck: false`.
`createContainer` and `makeCreateContainerFunction` now have explicit
return types (TS2344 before), with the same props as before.
`ErrorBar`'s props are `ErrorBarProps` instead of `any` (`typeof
ErrorBar.default`, TS2339 before). Code that passed `ErrorBar`
undeclared props, or wrongly typed ones, compiled only because of this
and now fails to type-check. `Axis.getTicks` returns `number[] |
string[] | Date[]`: it returns `Date`s for date `tickValues`, which its
inferred `number[] | string[]` left out (also `VictoryAxis`'s inferred
`ticks`).

- [#3160](#3160)
[`37c7a74`](37c7a74)
- Build type declarations with `@types/react` 19. Refs from
`useCanvasContext()` (`canvasRef`) and `useVictoryContainer()`
(`localContainerRef`) are now typed `RefObject<HTMLCanvasElement |
null>` and `RefObject<HTMLDivElement | null>` (no change on
`@types/react` 18; correct on 19). Inferred `ReactElement` return types
of some render methods now use `unknown` props instead of `any`, and
class component types no longer list the legacy `refs` property. Code
type-checks the same on `@types/react` 18 and 19.
## victory-area@38.1.0

### Patch Changes

- [#3160](#3160)
[`37c7a74`](37c7a74)
- Build type declarations with `@types/react` 19. Refs from
`useCanvasContext()` (`canvasRef`) and `useVictoryContainer()`
(`localContainerRef`) are now typed `RefObject<HTMLCanvasElement |
null>` and `RefObject<HTMLDivElement | null>` (no change on
`@types/react` 18; correct on 19). Inferred `ReactElement` return types
of some render methods now use `unknown` props instead of `any`, and
class component types no longer list the legacy `refs` property. Code
type-checks the same on `@types/react` 18 and 19.
## victory-axis@38.1.0

### Patch Changes

- [#3164](#3164)
[`1e3997f`](1e3997f)
- Fix type errors in published declarations under `skipLibCheck: false`.
`createContainer` and `makeCreateContainerFunction` now have explicit
return types (TS2344 before), with the same props as before.
`ErrorBar`'s props are `ErrorBarProps` instead of `any` (`typeof
ErrorBar.default`, TS2339 before). Code that passed `ErrorBar`
undeclared props, or wrongly typed ones, compiled only because of this
and now fails to type-check. `Axis.getTicks` returns `number[] |
string[] | Date[]`: it returns `Date`s for date `tickValues`, which its
inferred `number[] | string[]` left out (also `VictoryAxis`'s inferred
`ticks`).

- [#3160](#3160)
[`37c7a74`](37c7a74)
- Build type declarations with `@types/react` 19. Refs from
`useCanvasContext()` (`canvasRef`) and `useVictoryContainer()`
(`localContainerRef`) are now typed `RefObject<HTMLCanvasElement |
null>` and `RefObject<HTMLDivElement | null>` (no change on
`@types/react` 18; correct on 19). Inferred `ReactElement` return types
of some render methods now use `unknown` props instead of `any`, and
class component types no longer list the legacy `refs` property. Code
type-checks the same on `@types/react` 18 and 19.
## victory-bar@38.1.0

### Patch Changes

- [#3160](#3160)
[`37c7a74`](37c7a74)
- Build type declarations with `@types/react` 19. Refs from
`useCanvasContext()` (`canvasRef`) and `useVictoryContainer()`
(`localContainerRef`) are now typed `RefObject<HTMLCanvasElement |
null>` and `RefObject<HTMLDivElement | null>` (no change on
`@types/react` 18; correct on 19). Inferred `ReactElement` return types
of some render methods now use `unknown` props instead of `any`, and
class component types no longer list the legacy `refs` property. Code
type-checks the same on `@types/react` 18 and 19.
## victory-box-plot@38.1.0

### Patch Changes

- [#3160](#3160)
[`37c7a74`](37c7a74)
- Build type declarations with `@types/react` 19. Refs from
`useCanvasContext()` (`canvasRef`) and `useVictoryContainer()`
(`localContainerRef`) are now typed `RefObject<HTMLCanvasElement |
null>` and `RefObject<HTMLDivElement | null>` (no change on
`@types/react` 18; correct on 19). Inferred `ReactElement` return types
of some render methods now use `unknown` props instead of `any`, and
class component types no longer list the legacy `refs` property. Code
type-checks the same on `@types/react` 18 and 19.
## victory-brush-container@38.1.0

### Patch Changes

- [#3163](#3163)
[`e1909f7`](e1909f7)
- Type declarations no longer reference lodash's types, which consumers
don't have (`@types/lodash` isn't a dependency): they resolved to `any`,
or failed with TS7016 under `skipLibCheck: false`. The throttled helper
handlers (`BrushHelpers.onGlobalMouseMove`, `onMouseMove`,
`ZoomHelpers.onWheel`, ...) are now typed with their call signature,
`cancel()` and `flush()`, and `VictorySharedEvents`'s
`getBaseProps`/`getBasePropsFromChildren` return `Record<string, any>`.
## victory-candlestick@38.1.0

### Patch Changes

- [#3160](#3160)
[`37c7a74`](37c7a74)
- Build type declarations with `@types/react` 19. Refs from
`useCanvasContext()` (`canvasRef`) and `useVictoryContainer()`
(`localContainerRef`) are now typed `RefObject<HTMLCanvasElement |
null>` and `RefObject<HTMLDivElement | null>` (no change on
`@types/react` 18; correct on 19). Inferred `ReactElement` return types
of some render methods now use `unknown` props instead of `any`, and
class component types no longer list the legacy `refs` property. Code
type-checks the same on `@types/react` 18 and 19.
## victory-canvas@38.1.0

### Patch Changes

- [#3160](#3160)
[`37c7a74`](37c7a74)
- Build type declarations with `@types/react` 19. Refs from
`useCanvasContext()` (`canvasRef`) and `useVictoryContainer()`
(`localContainerRef`) are now typed `RefObject<HTMLCanvasElement |
null>` and `RefObject<HTMLDivElement | null>` (no change on
`@types/react` 18; correct on 19). Inferred `ReactElement` return types
of some render methods now use `unknown` props instead of `any`, and
class component types no longer list the legacy `refs` property. Code
type-checks the same on `@types/react` 18 and 19.
## victory-create-container@38.1.0

### Patch Changes

- [#3164](#3164)
[`1e3997f`](1e3997f)
- Fix type errors in published declarations under `skipLibCheck: false`.
`createContainer` and `makeCreateContainerFunction` now have explicit
return types (TS2344 before), with the same props as before.
`ErrorBar`'s props are `ErrorBarProps` instead of `any` (`typeof
ErrorBar.default`, TS2339 before). Code that passed `ErrorBar`
undeclared props, or wrongly typed ones, compiled only because of this
and now fails to type-check. `Axis.getTicks` returns `number[] |
string[] | Date[]`: it returns `Date`s for date `tickValues`, which its
inferred `number[] | string[]` left out (also `VictoryAxis`'s inferred
`ticks`).
## victory-cursor-container@38.1.0

### Patch Changes

- [#3163](#3163)
[`e1909f7`](e1909f7)
- Type declarations no longer reference lodash's types, which consumers
don't have (`@types/lodash` isn't a dependency): they resolved to `any`,
or failed with TS7016 under `skipLibCheck: false`. The throttled helper
handlers (`BrushHelpers.onGlobalMouseMove`, `onMouseMove`,
`ZoomHelpers.onWheel`, ...) are now typed with their call signature,
`cancel()` and `flush()`, and `VictorySharedEvents`'s
`getBaseProps`/`getBasePropsFromChildren` return `Record<string, any>`.
## victory-errorbar@38.1.0

### Patch Changes

- [#3164](#3164)
[`1e3997f`](1e3997f)
- Fix type errors in published declarations under `skipLibCheck: false`.
`createContainer` and `makeCreateContainerFunction` now have explicit
return types (TS2344 before), with the same props as before.
`ErrorBar`'s props are `ErrorBarProps` instead of `any` (`typeof
ErrorBar.default`, TS2339 before). Code that passed `ErrorBar`
undeclared props, or wrongly typed ones, compiled only because of this
and now fails to type-check. `Axis.getTicks` returns `number[] |
string[] | Date[]`: it returns `Date`s for date `tickValues`, which its
inferred `number[] | string[]` left out (also `VictoryAxis`'s inferred
`ticks`).

- [#3160](#3160)
[`37c7a74`](37c7a74)
- Build type declarations with `@types/react` 19. Refs from
`useCanvasContext()` (`canvasRef`) and `useVictoryContainer()`
(`localContainerRef`) are now typed `RefObject<HTMLCanvasElement |
null>` and `RefObject<HTMLDivElement | null>` (no change on
`@types/react` 18; correct on 19). Inferred `ReactElement` return types
of some render methods now use `unknown` props instead of `any`, and
class component types no longer list the legacy `refs` property. Code
type-checks the same on `@types/react` 18 and 19.
## victory-histogram@38.1.0

### Patch Changes

- [#3160](#3160)
[`37c7a74`](37c7a74)
- Build type declarations with `@types/react` 19. Refs from
`useCanvasContext()` (`canvasRef`) and `useVictoryContainer()`
(`localContainerRef`) are now typed `RefObject<HTMLCanvasElement |
null>` and `RefObject<HTMLDivElement | null>` (no change on
`@types/react` 18; correct on 19). Inferred `ReactElement` return types
of some render methods now use `unknown` props instead of `any`, and
class component types no longer list the legacy `refs` property. Code
type-checks the same on `@types/react` 18 and 19.
## victory-legend@38.1.0

### Patch Changes

- [#3160](#3160)
[`37c7a74`](37c7a74)
- Build type declarations with `@types/react` 19. Refs from
`useCanvasContext()` (`canvasRef`) and `useVictoryContainer()`
(`localContainerRef`) are now typed `RefObject<HTMLCanvasElement |
null>` and `RefObject<HTMLDivElement | null>` (no change on
`@types/react` 18; correct on 19). Inferred `ReactElement` return types
of some render methods now use `unknown` props instead of `any`, and
class component types no longer list the legacy `refs` property. Code
type-checks the same on `@types/react` 18 and 19.
## victory-line@38.1.0

### Patch Changes

- [#3160](#3160)
[`37c7a74`](37c7a74)
- Build type declarations with `@types/react` 19. Refs from
`useCanvasContext()` (`canvasRef`) and `useVictoryContainer()`
(`localContainerRef`) are now typed `RefObject<HTMLCanvasElement |
null>` and `RefObject<HTMLDivElement | null>` (no change on
`@types/react` 18; correct on 19). Inferred `ReactElement` return types
of some render methods now use `unknown` props instead of `any`, and
class component types no longer list the legacy `refs` property. Code
type-checks the same on `@types/react` 18 and 19.
## victory-pie@38.1.0

### Patch Changes

- [#3160](#3160)
[`37c7a74`](37c7a74)
- Build type declarations with `@types/react` 19. Refs from
`useCanvasContext()` (`canvasRef`) and `useVictoryContainer()`
(`localContainerRef`) are now typed `RefObject<HTMLCanvasElement |
null>` and `RefObject<HTMLDivElement | null>` (no change on
`@types/react` 18; correct on 19). Inferred `ReactElement` return types
of some render methods now use `unknown` props instead of `any`, and
class component types no longer list the legacy `refs` property. Code
type-checks the same on `@types/react` 18 and 19.
## victory-polar-axis@38.1.0

### Patch Changes

- [#3160](#3160)
[`37c7a74`](37c7a74)
- Build type declarations with `@types/react` 19. Refs from
`useCanvasContext()` (`canvasRef`) and `useVictoryContainer()`
(`localContainerRef`) are now typed `RefObject<HTMLCanvasElement |
null>` and `RefObject<HTMLDivElement | null>` (no change on
`@types/react` 18; correct on 19). Inferred `ReactElement` return types
of some render methods now use `unknown` props instead of `any`, and
class component types no longer list the legacy `refs` property. Code
type-checks the same on `@types/react` 18 and 19.
## victory-scatter@38.1.0

### Patch Changes

- [#3160](#3160)
[`37c7a74`](37c7a74)
- Build type declarations with `@types/react` 19. Refs from
`useCanvasContext()` (`canvasRef`) and `useVictoryContainer()`
(`localContainerRef`) are now typed `RefObject<HTMLCanvasElement |
null>` and `RefObject<HTMLDivElement | null>` (no change on
`@types/react` 18; correct on 19). Inferred `ReactElement` return types
of some render methods now use `unknown` props instead of `any`, and
class component types no longer list the legacy `refs` property. Code
type-checks the same on `@types/react` 18 and 19.
## victory-selection-container@38.1.0

### Patch Changes

- [#3163](#3163)
[`e1909f7`](e1909f7)
- Type declarations no longer reference lodash's types, which consumers
don't have (`@types/lodash` isn't a dependency): they resolved to `any`,
or failed with TS7016 under `skipLibCheck: false`. The throttled helper
handlers (`BrushHelpers.onGlobalMouseMove`, `onMouseMove`,
`ZoomHelpers.onWheel`, ...) are now typed with their call signature,
`cancel()` and `flush()`, and `VictorySharedEvents`'s
`getBaseProps`/`getBasePropsFromChildren` return `Record<string, any>`.
## victory-shared-events@38.1.0

### Patch Changes

- [#3163](#3163)
[`e1909f7`](e1909f7)
- Type declarations no longer reference lodash's types, which consumers
don't have (`@types/lodash` isn't a dependency): they resolved to `any`,
or failed with TS7016 under `skipLibCheck: false`. The throttled helper
handlers (`BrushHelpers.onGlobalMouseMove`, `onMouseMove`,
`ZoomHelpers.onWheel`, ...) are now typed with their call signature,
`cancel()` and `flush()`, and `VictorySharedEvents`'s
`getBaseProps`/`getBasePropsFromChildren` return `Record<string, any>`.
## victory-voronoi@38.1.0

### Patch Changes

- [#3160](#3160)
[`37c7a74`](37c7a74)
- Build type declarations with `@types/react` 19. Refs from
`useCanvasContext()` (`canvasRef`) and `useVictoryContainer()`
(`localContainerRef`) are now typed `RefObject<HTMLCanvasElement |
null>` and `RefObject<HTMLDivElement | null>` (no change on
`@types/react` 18; correct on 19). Inferred `ReactElement` return types
of some render methods now use `unknown` props instead of `any`, and
class component types no longer list the legacy `refs` property. Code
type-checks the same on `@types/react` 18 and 19.
## victory-voronoi-container@38.1.0

### Patch Changes

- [#3163](#3163)
[`e1909f7`](e1909f7)
- Type declarations no longer reference lodash's types, which consumers
don't have (`@types/lodash` isn't a dependency): they resolved to `any`,
or failed with TS7016 under `skipLibCheck: false`. The throttled helper
handlers (`BrushHelpers.onGlobalMouseMove`, `onMouseMove`,
`ZoomHelpers.onWheel`, ...) are now typed with their call signature,
`cancel()` and `flush()`, and `VictorySharedEvents`'s
`getBaseProps`/`getBasePropsFromChildren` return `Record<string, any>`.
## victory-zoom-container@38.1.0

### Patch Changes

- [#3163](#3163)
[`e1909f7`](e1909f7)
- Type declarations no longer reference lodash's types, which consumers
don't have (`@types/lodash` isn't a dependency): they resolved to `any`,
or failed with TS7016 under `skipLibCheck: false`. The throttled helper
handlers (`BrushHelpers.onGlobalMouseMove`, `onMouseMove`,
`ZoomHelpers.onWheel`, ...) are now typed with their call signature,
`cancel()` and `flush()`, and `VictorySharedEvents`'s
`getBaseProps`/`getBasePropsFromChildren` return `Record<string, any>`.
## victory@38.1.0

No changes in this release.
## victory-brush-line@38.1.0

No changes in this release.
## victory-chart@38.1.0

No changes in this release.
## victory-group@38.1.0

No changes in this release.
## victory-stack@38.1.0

No changes in this release.
## victory-tooltip@38.1.0

No changes in this release.
## victory-vendor@38.1.0

No changes in this release.

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

This branch was successfully deployed

1 active deployment
Preview — 15565a48 Deployed Nov 10, 2026 by vercel[bot]
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.

2 participants