title: Pass data between class Component and function (React)
body: <p>I got class Component where I'm passing data:</p>
  <pre><code>import React, { Component } from 'react';
  import { Link } from 'react-router-dom';
  
  class VisitDetails extends Component {
   //...
   render() {
   
   //...
     return() {
        &lt;div&gt;
           {/*pass to function EditVisit.js*/}
          &lt;Link to={{pathname: `/visit/edit/${id}`, state: {data}}}&gt;Edit&lt;/Link&gt;
        &lt;div&gt;
     }
   }
  }
  </code></pre>
  <p>Now I got function:</p>
  <pre><code>import React, { useState } from 'react';
  import { useHistory } from &quot;react-router-dom&quot;;
  
  function EditVisit (data) {
    console.log(data.info)
   return(
     &lt;div&gt;
      Info: {data.info}
     &lt;div&gt;
   )
  }
  </code></pre>
  <p>but <code>data.info</code> is no render (<strong>undefined</strong>).</p>