Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change PropType of CarouselItem to allow any node as children #719

Closed
torkjels opened this issue Nov 30, 2017 · 1 comment
Closed

Change PropType of CarouselItem to allow any node as children #719

torkjels opened this issue Nov 30, 2017 · 1 comment

Comments

@torkjels
Copy link

Issue description

  • components: CarouselItem
  • reactstrap version: 5.0.0-alpha.4
  • import method : es
  • react version: 16.1.1
  • bootstrap version: 4.0.0-beta.2

What is happening?

In a CarouselItem I'm able to put custom markup (as Bootstrap 4's Carousel documentation says you can), and it renders as it should. However, I get a warning in the console saying:
"Failed prop type: Invalid prop children.type of value div supplied to CarouselItem, expected one of [null]."

What should be happening?

There shouldn't be any warning like this, because any type of custom markup should be able to pass as a child to CarouselItem, as per Bootstrap 4 docs.
From what I can see a possible fix would be to change CarouselItem's children PropType to node. Additionally, one should be able to pass down a key, as it's currently using the "src" attribute, which can't be guaranteed if the CarouselItem is custom markup, not an image.

Steps to reproduce issue

  1. Create a Carousel with a CarouselItem that has custom markup as children.

Error message in console

Warning: Failed prop type: Invalid prop `children.type` of value `div` supplied to `CarouselItem`, expected one of [null].
    in CarouselItem (at Carousel.js:110)
@supergibbs
Copy link
Collaborator

Fixed by #735

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants