title: How correctly call multiple functions ReactJS
body: <p>I would like to explain my problem of the day.</p>
  
  <p>currently, I have 2 functions that work proper</p>
  
  <p>I wish I could have both functions on one button</p>
  
  <p>When they are separated the functions work correctly, my problem and when I try to pass them on a single button I have an error that appears
  "Cannot read property 'preventDefault' of undefined"</p>
  
  <p>How can I fix this issue?thx all</p>
  
  <p>make room for the code</p>
  
  <p>my first function </p>
  
  <pre><code>putBack = (e, id) =&gt; {
  e.preventDefault();
  const config = {
    method: "PUT",
    headers: {
      "Content-Type": "application/json",
    },
    body: JSON.stringify({ id: id, livree: new Date().toISOString().slice(11, 16)}),
  };
  const url = entrypoint + "/alluserpls";
  fetch(url, config)
  .then(res =&gt; res.json())
  .then(res =&gt; {
  if (res.error) {
  alert(res.error);
  } else {
  alert(`ajouté avec l'ID ${res}!`);
  }
  }).catch(e =&gt; {
  console.error(e);
  }).finally(() =&gt; this.setState({ redirect: true })); }
  </code></pre>
  
  <p>my second function </p>
  
  <pre><code>onChange = (id, status) =&gt; {
  const validatedorder = JSON.parse(localStorage.getItem("validated-order") || "{}");
  localStorage.setItem("validated-order", JSON.stringify({ ...validatedorder, [id]: status }))
  
  this.setState({ color: 'red' });
  this.setState({ title: 'Confirmer la livraison' });
  
  console.log('cliqué pour preparation')
  this.setState({
    statut :'preparation',
    id,
  });
  }
  </code></pre>
  
  <p>my multiple functions </p>
  
  <pre><code>megaTryMulti(e){
  e.preventDefault();
  this.putBack();
  this.onChange();
  }
  </code></pre>
  
  <p>function separate. (that work )</p>
  
  <pre><code>&lt;form onSubmit={(e) =&gt; this.putBack(e, datass.id)}&gt;
     &lt;button type="submit"&gt;PUT&lt;/button&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>second function separate (that work)</p>
  
  <pre><code>&lt;Button style={{ backgroundColor: status === undefined || status === false ? "red" : "#4DD5C7" }} disabled={status === false} onClick={() =&gt; this.onChange(datass.id, !status)} className="buttonForLancerMaybe"&gt;{status === undefined ? "Lancer" : status === true ? "Confirmer la livraison" : "SERVI"}&lt;/Button&gt;
  </code></pre>
  
  <p>multi function ( that is my problem and she don't works ) </p>
  
  <pre><code>  &lt;form onSubmit={(e) =&gt; this.megaTryMulti(e)}&gt;  
       &lt;Button type="submit"&gt;test&lt;/Button&gt;
     &lt;/form&gt;
  </code></pre>