M
M
Mesuti2020-05-07 15:09:53
React
Mesuti, 2020-05-07 15:09:53

How to bind a function to one particular component?

Hey!
A little confused.

On page 3, the inputs are rendered by a single component.
How to bind the function of changing state.counter , which is displayed just below, to the last 1 component?

If you pass a function to props , then in general all components will access it.
Or do I misunderstand? Tell me please

Sandbox

5eb3fa903c3fe264989862.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
Nick, 2020-05-07
@Mesuti

https://codesandbox.io/s/clever-glade-okcv9
corrected the first thing that caught my eye (e.target.value, destructuring to const, ignoring onChange, etc.) I
advise you to read about forms

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question