title: How to filter array with Hooks?
body: <p>I am currently working on a class-based function. Trying to convert the class to a stateless function, followed by refactoring my code for each event handler from this.SetState to useState (in this case setMovies).</p>
  
  <p>This is my code (partial code):</p>
  
  <pre><code>const Movies = () =&gt; {
      const [movies, setMovies] = useState(getMovies());
      const [disabled, setDisabled] = useState(true);
      const [pageSize, setPageSize] = useState(4);
  
  const sortBy = sortType =&gt; {
      setMovies(movies.filter(sortType));
      setDisabled(false);
      // this.setState({
      //     movies: this.state.movies.sort(sortType),
      //     isDisabled: false,
      // });
  };
  </code></pre>
  
  <p>it seems that It is not possible to filter this state. I am able to change to boolean but can't filter my Array. Is there a way to filter using Hooks?</p>
  
  <p>Thanks in advance.</p>