A
A
Alexey Orlov2020-08-15 13:38:32
JavaScript
Alexey Orlov, 2020-08-15 13:38:32

How to bind components in React?

I just recently started learning React so I have a question.
I have an App file which has an element and a Button file with a similar component. How to connect App and Button so that when the button is clicked, the value of element , which is in the App, changes (for example, one is subtracted from the value)?
Sandbox

Answer the question

In order to leave comments, you need to log in

1 answer(s)
H
hzzzzl, 2020-08-15
@LeshaGFB

https://codesandbox.io/s/frosty-voice-3bjhb
https://ru.reactjs.org/tutorial/tutorial.html#pass...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question