title: Are hooks called in each render?
body: <p>I am using context api and hooks, there are 20 state variables, in each changes (setting states) the function calls again or re-renders so my concern is about calling hooks functions.</p>
  
  <p>Example if I use <code>useState, useReducer, useMemo, useCallback</code> are they called again per any re-render?</p>
  
  <pre><code>function GroupProvider(props) {
  
      const socket = useMemo(()=&gt; io(url), [socket]);
      const [grouplist, setGrouplist] = useState([]);
      const [refreshid, setRefreshid] = useState('');
      const [messages, setMessages] = useState({});
      const [ppl, setPpl] = useState(people);
      const [groupname, setGroupname] = useState(name);
      const [groupimg, setGroupimg] = useState(img);
      const [groupnamesaving, setGroupnamesaving] = useState(false);
      const [groupimgsaving, setGroupimgsaving] = useState(false);
      const [editgroupname, setEditgroupname] = useState(false);
      const [addingmember, setAddingmember] = useState(false);
      const [modalVisible, setModalVisible] = useState(false);
      const [leavinggroup, setLeavinggroup] = useState(false);
      const [changeAdminModal, setChangeAdminModal] = useState(false);
      const [changingAdmin, setChangingAdmin] = useState(false);
      const [loadingModal, setLoadingModal] = useState(false);
  
  }
  </code></pre>
  
  <p><strong>Here if in each re-rendering, hooks function calls, so it may affect on performance.</strong></p>