title: How do you call a function in a react-table accessor? (reactjs)
body: <p>I am modifying a ReactJS component. I have added a react-table to get the pagination, which works beautifully.  But one of the columns in the table needs to call a function that is also in this component, so it can render a link depending on the content of that record.  (Some results will render a link, some will not.)  When I list the function in the accessor property of the column, it returns some of the values from the function, but not all of them.  So, the link comes back as: </p>
  
  <pre><code>    localhost:3000/view/c/IDnumber/undefined.  
  </code></pre>
  
  <p>Both the IDnumber and query should be returned, but the query parameter is "undefined".</p>
  
  <p>I've tried listing the function in the accessor like:</p>
  
  <pre><code>    getSerialNo(hit,query)
  </code></pre>
  
  <p>But then I get "hit is not defined".
  I've searched on this site and others to find a solution.</p>
  
  <p>The column looks like:</p>
  
  <pre><code>    {id:'serialno',
      Header: "Serial #",
      accessor: getSerialNo
      }
  </code></pre>
  
  <p>The function, in part, looks like:</p>
  
  <pre><code>    const getSerialNo = (hit, query) =&gt; {
          const linkAs = '/view/c/${hit._id}/${query}'
      return &lt;Link href={link} as={linkAs}&gt;&lt;a target="_blank"&gt;{serialNo}
       &lt;/a&gt;&lt;/Link&gt;
  </code></pre>
  
  <p>I would like to get back a link that actually includes the query, like:</p>
  
  <pre><code>    localhost:3000/view/c/IDnumber/query
  </code></pre>