---
title: "Comment by Mariusz Kowalski on \"Polymorphic components in React\" | Hashnode"
description: "Can this pattern be combined with StyledComponents? If so, how to do it right?"
url: "https://hashnode.com/posts/polymorphic-components-in-react/65d1053c3e8dc8840410d06c/comment/65d286b86e214c4fb603edb0"
---

[Discussion](https://hashnode.com/posts/polymorphic-components-in-react/65d1053c3e8dc8840410d06c)

Comment [Polymorphic components in React](https://hashnode.com/posts/polymorphic-components-in-react/65d1053c3e8dc8840410d06c)

[Mariusz Kowalski](https://hashnode.com/@Snien)

[Feb 18, 2024](https://hashnode.com/posts/polymorphic-components-in-react/65d1053c3e8dc8840410d06c/comment/65d286b86e214c4fb603edb0)

Can this pattern be combined with StyledComponents? If so, how to do it right?

[Michał Miszczyszyn](https://hashnode.com/@typeofweb)

[Feb 19, 2024](https://hashnode.com/posts/polymorphic-components-in-react/65d1053c3e8dc8840410d06c/comment/65d286b86e214c4fb603edb0#reply-65d335b36e035e36b33c9347)

No clue. I don't use styled components and I don't recommend using them to anyone.

[Mariusz Kowalski](https://hashnode.com/@Snien)

[Feb 21, 2024](https://hashnode.com/posts/polymorphic-components-in-react/65d1053c3e8dc8840410d06c/comment/65d286b86e214c4fb603edb0#reply-65d658ad5ffe3f7c88097a27)

[Michał Miszczyszyn](https://hashnode.com/@typeofweb)

Ok, then I am missing a key piece of information in the presented pattern - how to pass information to < UIButton /> about what state the placed children are in, especially when our UI is dependent on the state of the application (spinner animation in the UIButton when it processes a request, or disabled state) e.g:

< UIButton > < button > Send Request < / button > < / UIButton >.

< Link >Try to redirect < / Link > < / UIButton >.

[Michał Miszczyszyn](https://hashnode.com/@typeofweb)

[Feb 24, 2024](https://hashnode.com/posts/polymorphic-components-in-react/65d1053c3e8dc8840410d06c/comment/65d286b86e214c4fb603edb0#reply-65d9e7430458829619862f74)

[Mariusz Kowalski](https://hashnode.com/@Snien) that's a good point; the UI components could accept props that influence how they look, i.e. variant or disabled.
