BotDanny / react-stacked-center-carousel

A responsive, performant, well animated, swipeable, center mode carousel that stacks its slide
33 stars 12 forks source link

Objects are not valid as a React child in react-stacked-center-carousel #20

Closed asadali012 closed 8 months ago

asadali012 commented 8 months ago

I am using react-stacked-center-carousel and the code is defined in https://codesandbox.io/s/elegant-snowflake-k3rf75?file=/src/App.js

now when i pass an array of objects to this gives an error

Objects are not valid as a React child (found: object with keys {$$typeof, type, compare}). If you meant to render a collection of children, use an array instead.

As i am defining data as an array

BotDanny commented 8 months ago

Hi, please post a codesandbox link to reproduce the error. I don't see any issue with the codesandbox you provided.

asadali012 commented 8 months ago

Hi, please post a codesandbox link to reproduce the error. I don't see any issue with the codesandbox you provided.

https://codesandbox.io/s/sad-dirac-ptfl8z?file=/src/App.js

This is the sandbox with the issue

BotDanny commented 8 months ago

Hi, you exported your slide component using named export, but you imported your slide component as default import. Change your slide component import from import Slide from "../components/Slide"; to import {Slide} from "../components/Slide"; then it will work. The carousel itself has no issue.

asadali012 commented 8 months ago

@BotDanny Resolved ThankYou