brainhubeu / react-carousel

A pure extendable React carousel, powered by Brainhub (craftsmen who ❤️ JS)
https://brainhub.eu/
MIT License
1.07k stars 164 forks source link

Why there is no working carousel for React? #714

Open Maclay74 opened 3 years ago

Maclay74 commented 3 years ago

I feel like I tried all of them. This one was the most promising, but still doesn't work at all.

Why we don't have any working solution? Why for JQuery all of them are working, more or less, but front-end, even more advanced field, has no one single working carousel?

Why am I saying that it doesn't work? Because it doesn't! When you install it and try to implement the most basic example, you got an error in your console from internal code.

image

Okay, maybe need to go deeper, alright. Maybe it works, but just an error.

Next problem is that your slides are invisible If you use collection.map(item => ...). By default. Why? The hell knows. In order to fix it, need to add settings, plugins. Alright, it fixed too with pain.

Don't you think it's all? Naaaaaah, no way! When you want to render multiple items and one more, like

<Carousel>
        {collection.map((item) => (
          <Item key={item.id} />
        ))}
        <OneMoreComponent/>
</Carousel>

It won't work! You'll get all your items in one slide and OneMoreComponent in another. Why is that happening? Okay, maybe render them as fragment? Nah, then we get Maximum call stack exceeded.

And this is not only about this carousel. All of them are broken in different way. This one turned out to be top 4-3 I guess.

Why we have plenty solutions for other problems, like, modals, animations and other stuff which just WORK? Why there is no single one working carousel for React?

Maclay74 commented 3 years ago

And, you know, bugs are okay. If you open tracker of any widely-used software, there are hundreds of them.

But almost all of them because of advanced usage, when you doing something odd, not trivial.

I am just trying to follow the README tutorial and faced bug-wall, cmon!

Maclay74 commented 3 years ago

image

Are you seriously using this?

Is React.Children.toArray(this.props.children) just a joke? Of course it won't work!

Beelphegor commented 3 years ago

image

Are you seriously using this?

Is React.Children.toArray(this.props.children) just a joke? Of course it won't work!

Your ramblings are not useful in any way, you should consider contributing to the project instead.

shaunstoltz commented 3 years ago

I got this working by used the source and removing all the scss imports as they were bugging in my build environment. Simple import of the index.js file from the src directory here https://github.com/brainhubeu/react-carousel/tree/master/react-carousel/src and the errors about setState were resolved.

Maclay74 commented 3 years ago

image Are you seriously using this? Is React.Children.toArray(this.props.children) just a joke? Of course it won't work!

Your ramblings are not useful in any way, you should consider contributing to the project instead.

Yes, if this would at least build on local machine. They messed with dependencies and I don't want to spend my day fixing their bugs.

I'd faster implement it by myself from scratch

Maclay74 commented 3 years ago

Thanks God, I found it! Don't waste your time, use swiper, it works. https://swiperjs.com/