How to destructure e.target when hyphens are in the attribute?
<p>I have an input field that looks like this:</p>
<pre><code>&lt;input placeholder=&quot;Card Number&quot; name=&quot;cc-number&quot; data-stripe=&quot;number&quot; class=&quot;add-card-form__card-number input&quot; value=&quot;&quot;&gt;
</code></pre>
<p>I'd like to do something like this:</p>
<pre><code>onFocus (e) {
  const { 'data-stripe': name, value } = e.target
  // do something with `name` and `value`
}
</code></pre>
<p>I know I can use <code>e.target.getAttribute('data-stripe')</code>, but that defeats the purpose of destructuring. Any ideas how to do this?</p>
<p>Here it says exactly what I'm doing. <a href="https://stackoverflow.com/questions/38762715/how-to-destructure-object-properties-with-key-names-that-are-invalid-variable-na">How to destructure object properties with key names that are invalid variable names?</a></p>