Cannot read properties of undefined (reading 'type') #4023
Unanswered
palakbansal3233
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Error in function t.value in ./node_modules/apexcharts/dist/apexcharts.common.js:6
Cannot read properties of undefined (reading 'type')"
Getting this error after Importing apexcharts through loadable components.
`import Loadable from '@loadable/component';
const ClientSideChart = Loadable(() => import('./line-chart'));
export default ClientSideChart;
`
`import React from 'react';
import PropTypes from 'prop-types';
import Chart from 'react-apexcharts';
const ChartComponent = ({ options, series, type, width, height }) => {
return (
<Chart {...options} width={width} height={height} {...series} type={type} />
);
};
ChartComponent.propTypes = {
height: PropTypes.string.isRequired,
options: PropTypes.object.isRequired,
width: PropTypes.string,
series: PropTypes.object.isRequired,
type: PropTypes.string,
};
ChartComponent.defaultProps = {
type: 'line',
width: '100%',
};
export default ChartComponent;
`
Beta Was this translation helpful? Give feedback.
All reactions