S
S
smartbe2020-09-14 19:21:29
React
smartbe, 2020-09-14 19:21:29

Composite component?

Hello!

There is a big blue button component with animation. It is made as a composite component. It accepts childers through props and puts them in the button tag.

If you make a normal button, then everything is fine. But, I have a button the same blue in which the phone is stored, it is made with the a tag.

I would like to use the same button, but then in the composite component there will be a button tag in which the a tag is nested.

Question. Is there a smart way to do it? For example, how to compare, if a link (tag a) came to children, then display a different markup. How to do it better?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question