JavaScript React Basics (retired) Designing Data Flow Adding Players to the Scoreboard

Brian Foley
Brian Foley
8,439 Points

input field doesn't work

I'm hoping someone can spot for me why I can't type a name into my scoreboard. The error message in the console isn't really helpful. Any help is much appreciated!

Here's a link to my workspace: https://w.trhou.se/o19eej0cx2

1 Answer

Seth Kroger
Seth Kroger
56,378 Points

Starting line 41 you have:

  onNameChange: function(e) {

    this.setState({name: e.target.value});   // Usual boilerplate to tie form input to virtual DOM
    this.setState({name: ""});  // Then you immediately clear it
  }, 
Brian Foley
Brian Foley
8,439 Points

Thank you very much!