Hi,
I am building a hangman game and I would like to check if the word to be guessed is confirmed by the player or not using the method onClick
. There is 2 buttons : “Yes” and the second “No”. When I check the data value in the child component, I can see it updated but when I check it from the parent component, I am not able to see something from the child.
I have tried 2 different ways :
- Use
value
which brings me tons of errors - Use 2 functions with 2 different
setState
which look like the best approach when I checked how I could possibly solve this issue.
Unfortunately, I am kind of stuck right now. That is why I am asking for help
Here are the two main files : parent, child
Thanks in advance for your help.
P.S.: Excuse me for my english, it is not my native language. Do not hesitate to correct me if I have made mistakes