Skip to content

Commit

Permalink
feat: chart.js v4 support (#1109)
Browse files Browse the repository at this point in the history
  • Loading branch information
dangreen authored Nov 17, 2022
1 parent 6eb8ce7 commit deb2110
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 21 deletions.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
"updateGitHooks": "simple-git-hooks"
},
"peerDependencies": {
"chart.js": "^3.5.0",
"chart.js": "^3.5.0 || ^4.0.0",
"react": "^16.8.0 || ^17.0.0 || ^18.0.0"
},
"devDependencies": {
Expand Down Expand Up @@ -86,9 +86,9 @@
"@vitejs/plugin-react": "^2.2.0",
"@vitest/coverage-c8": "^0.25.2",
"browserslist": "^4.17.3",
"chart.js": "^3.1.0",
"chart.js": "^4.0.1",
"chartjs-adapter-date-fns": "^2.0.0",
"chartjs-plugin-annotation": "^1.4.0",
"chartjs-plugin-annotation": "^2.0.1",
"chartjs-plugin-zoom": "^1.2.1",
"clean-publish": "^4.0.0",
"commitizen": "^4.2.4",
Expand Down
33 changes: 17 additions & 16 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion src/chart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -107,4 +107,6 @@ function ChartComponent<
);
}

export const Chart = forwardRef(ChartComponent) as TypedChartComponent;
export const Chart: TypedChartComponent = forwardRef(
ChartComponent
) as TypedChartComponent;
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
/* Modules */
"baseUrl": ".",
"module": "ESNext",
"moduleResolution": "NodeNext",
"moduleResolution": "Node", // restore to "NodeNext" after Chart.js update
"resolveJsonModule": true,
/* Emit */
"declaration": true,
Expand Down

0 comments on commit deb2110

Please sign in to comment.