title: Next.js with Typescript - how to access app.js props and staticProps in functional component
body: <p>I want to know if it's possible for me to access props passed down from app.js to all Component Page using typescript and functional components. Take a look at app.js and index.ts</p>
  <p>app.js:</p>
  <pre><code>function MyApp({ Component, pageProps, router }) {
  
   const [message, setMessage] = useState(false)
   return (
     &lt;Component setMessage={setMessage} key={router.route} {...pageProps} /&gt;
   )
  }
  export default MyApp
  </code></pre>
  <p>Index.ts:</p>
  <pre><code>function Home({products}): InferGetStaticPropsType&lt;typeof getStaticProps&gt;) {
  
   return (
     &lt;div&gt;Home&lt;/div&gt;
   )
  }
  
  export function getStaticProps(){
     const products = []
  }
  </code></pre>
  <p>I would like to be able to access the setMessage function AND the products from getStaticProps in the index.ts page. I might be doing things the wrong way, thank you for your advice.</p>