B
B
Black_Fire2020-09-29 23:48:43
React
Black_Fire, 2020-09-29 23:48:43

How to create the same components with different content?

Let's say I use a class approach to create several buttonon a page. It is necessary that all these buttons have different text. That is, if I created a Button.js component module and exported it, then I import it into App.js and do it there as it should? Write strings to different variables that will be the text of buttons and using template strings and display this text in JSX?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
W
WbICHA, 2020-09-30
@WblCHA

I advise you to read the react documentation. Preferably all. Almost all questions will disappear by themselves.
https://ru.reactjs.org/docs/components-and-props.html

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question