charting-library-examples
charting-library-examples copied to clipboard
[next.js]fix: correct useRef type and container type casting
Add example checklist
- [x] Any commit does not contain the charting library's code
- [x] The example is self-sufficient and contains only necessary files/changes
Bug fix checklist
- [x] Any commit does not contain the charting library's code
- [x] Addresses an existing issue: #00000
Description
when run npm run build,the terminal shows:
Linting and checking validity of types ...Failed to compile.
./components/TVChartContainer/index.tsx:7:3
Type error: Expected 1 arguments, but got 0.
5 | export const TVChartContainer = (props: Partial<ChartingLibraryWidgetOptions>) => {
6 | const chartContainerRef =
> 7 | useRef<HTMLDivElement>() as React.MutableRefObject<HTMLInputElement>;
| ^
8 |
9 | useEffect(() => {
10 | const widgetOptions: ChartingLibraryWidgetOptions = {
Static worker exited with code: 1 and signal: null
New Behavior
npm run build works well,no typescript problem anymore