Skip to content

Commit deb2110

Browse files
authored
feat: chart.js v4 support (#1109)
1 parent 6eb8ce7 commit deb2110

File tree

4 files changed

+24
-21
lines changed

4 files changed

+24
-21
lines changed

package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
"updateGitHooks": "simple-git-hooks"
5656
},
5757
"peerDependencies": {
58-
"chart.js": "^3.5.0",
58+
"chart.js": "^3.5.0 || ^4.0.0",
5959
"react": "^16.8.0 || ^17.0.0 || ^18.0.0"
6060
},
6161
"devDependencies": {
@@ -86,9 +86,9 @@
8686
"@vitejs/plugin-react": "^2.2.0",
8787
"@vitest/coverage-c8": "^0.25.2",
8888
"browserslist": "^4.17.3",
89-
"chart.js": "^3.1.0",
89+
"chart.js": "^4.0.1",
9090
"chartjs-adapter-date-fns": "^2.0.0",
91-
"chartjs-plugin-annotation": "^1.4.0",
91+
"chartjs-plugin-annotation": "^2.0.1",
9292
"chartjs-plugin-zoom": "^1.2.1",
9393
"clean-publish": "^4.0.0",
9494
"commitizen": "^4.2.4",

pnpm-lock.yaml

+17-16
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/chart.tsx

+3-1
Original file line numberDiff line numberDiff line change
@@ -107,4 +107,6 @@ function ChartComponent<
107107
);
108108
}
109109

110-
export const Chart = forwardRef(ChartComponent) as TypedChartComponent;
110+
export const Chart: TypedChartComponent = forwardRef(
111+
ChartComponent
112+
) as TypedChartComponent;

tsconfig.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
/* Modules */
1212
"baseUrl": ".",
1313
"module": "ESNext",
14-
"moduleResolution": "NodeNext",
14+
"moduleResolution": "Node", // restore to "NodeNext" after Chart.js update
1515
"resolveJsonModule": true,
1616
/* Emit */
1717
"declaration": true,

0 commit comments

Comments
 (0)