Here is the code snippet I am working with:
import Glide from "@glidejs/glide";
const SectionSlider = () => {
const UNIQUE_CLASS = "random_string"
let MY_GLIDEJS = useMemo(() => {
return new Glide(`.${UNIQUE_CLASS}`, {
perView: itemPerRow,
gap: 32,
bound: true,
breakpoints: {
1280: {
perView: itemPerRow - 1,
},
1024: {
gap: 20,
perView: itemPerRow - 1,
},
768: {
gap: 20,
perView: itemPerRow - 2,
},
640: {
gap: 20,
perView: itemPerRow - 3,
},
500: {
gap: 20,
perView: 1.3,
},
},
});
}, [UNIQUE_CLASS]);
useEffect(() => {
setTimeout(() => {
MY_GLIDEJS.mount();
}, 100);
}, [MY_GLIDEJS, UNIQUE_CLASS]);
return (
<div className={`${UNIQUE_CLASS} flow-root`}>
...
</div>
)};
After trying to render this component, an error occurred:
TypeError: _glidejs_glide__WEBPACK_IMPORTED_MODULE_3__.default is not a constructor
In relation to this issue, here are the relevant packages I am using:
"dependencies": {
"@glidejs/glide": "^3.6.0",
"react": "18.2.0",
...
"devDependencies": {
"@types/glidejs__glide": "^3.6.0",
I am trying to pinpoint my mistake, could you please assist me in identifying it?