title: Is it possible to use props in React.hooks?
body: <p>I have a component X it accepts Y from props. Is it possible to use Y in hooks?<a href="https://codesandbox.io/s/5k23oprn6n" rel="nofollow noreferrer">cod</a></p>
  
  <pre><code>import React, { useState } from "react";
  
  function X({ y }) {
    const [index, setIndex] = useState(y);
    const ADD = () =&gt; {
      setIndex(index + 1);
    };
    return (
      &lt;div&gt;
        {index}
        &lt;button onClick={ADD}&gt;+&lt;/button&gt;
      &lt;/div&gt;
    );
  }
  </code></pre>