title: React Cannot read property 'getAttribute' of undefined
body: <p>I get the following error when trying to compile my app <code>TypeError: Cannot read property 'getAttribute' of undefined</code>.</p>
  
  <p>I'm having trouble tracking down why  in this line: <code>if (event.target.getAttribute('name') &amp;&amp; !sectionsClicked.includes(event.target.getAttribute('name'))) {</code> is error</p>
  
  <p>Here is the main react component</p>
  
  <pre><code>class App extends Component {
    constructor(props) {
      super(props);
      this.state = {
        progressValue: 0,
        sectionsClicked: [],
      };
  
      this.handleProgress = this.handleProgress.bind(this);
    }
  
  
    handleProgress = (event) =&gt; {
      const { progressValue } = this.state;
      console.log(progressValue);
      const { sectionsClicked } = this.state;
      if (event.target.getAttribute('name') &amp;&amp; !sectionsClicked.includes(event.target.getAttribute('name'))) {
        this.setState({
          progressValue: Math.floor((sectionsClicked.length / 77) * 100),
          sectionsClicked: sectionsClicked.push(event.target.getAttribute('name')),
        });
        console.log(sectionsClicked);
      }
    };
  
    render() {
      const { questions } = this.props;
      const { progressValue } = this.state;
      const groupByList = groupBy(questions.questions, 'type');
      const objectToArray = Object.entries(groupByList);
  
  
      return (
        &lt;&gt;
          &lt;Progress value={progressValue} /&gt;
          &lt;div className="text-center mt-5"&gt;
            &lt;ul&gt;
              {questionListItem &amp;&amp; questionListItem.length &gt; 0 ?
                (
                  &lt;Wizard
                    onChange={(event) =&gt; this.handleProgress(event)}
                    initialValues={{ employed: true }}
                    onSubmit={() =&gt; {
                      window.alert('Hello');
                    }}
                  &gt;
                    {questionListItem}
                  &lt;/Wizard&gt;
                ) : null
              }
            &lt;/ul&gt;
          &lt;/div&gt;
        &lt;/&gt;
      );
    }
  }
  </code></pre>