Answer the question
In order to leave comments, you need to log in
Why is the new element not being added to the store?
Created a simple CodeSandBox to show the problem - https://codesandbox.io/s/new-breeze-gf7st?file=/sr...
Trying to add a new comment with the add function which calls an action and throws an error you can see after clicking on the "leave a comment" button. In addition, in the action I am trying to pass the current value of the input through the parameter. I check it through console.log, and there, instead of value, the event onClick is displayed in general. This makes me think that I am doing everything wrong. Tell me, what are my mistakes and how to fix the code so that everything works correctly and comments are added?
Answer the question
In order to leave comments, you need to log in
You hung up the add function on the button click. What do you expect to get in it as an input parameter?
The click event itself will come to the fieldText variable, as it should be. What made you think that there should be some text there?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question