How to use the react-static.useRouteData function in react-static

To help you get started, we’ve selected a few react-static examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github 1productaweek / webframe / src / pages / categories.js View on Github external
export default function Categories () {
  const { categories } = useRouteData()
  const { CACHE_URL } = useSiteData()
  
  return (
    
      
      <h2>Categories</h2>
      <div>
        
          {(categories || []).map(cat =&gt; (
            
              
            </div>
github neo-one-suite / neo-one / packages / neo-one-website / src / pages / docs.tsx View on Github external
export default () =&gt; {
  const props = useRouteData();

  return (
    &lt;&gt;
      
      }&gt;
        
          
        
      
    
  );
};
github 1productaweek / webframe / src / containers / Screens.js View on Github external
function Screens () {
  const { parentTitle, parentPath, title, screens } = useRouteData()
  const hasScreens = screens &amp;&amp; screens.length
  return (
    
      {parentTitle &amp;&amp; <h2>{ parentTitle }</h2>}
      {parentTitle &amp;&amp; <h2> / </h2>}
      {title &amp;&amp; <h2>{ title }</h2>}
      <div>
        {hasScreens ?  : <p>No screens found!</p>}
      </div>
    
  )
}
github react-static / react-static / packages / react-static / templates / basic / src / pages / blog.js View on Github external
export default function Blog() {
  const { posts } = useRouteData()
  return (
    <div>
      <h1>It's blog time.</h1>
      <div>
        <a id="top" href="#bottom">
          Scroll to bottom!
        </a>
      </div>
      <br>
      All Posts:
      <ul>
        {posts.map(post =&gt; (
          <li>
            {post.title}
          </li>
        ))}</ul></div>
github neo-one-suite / neo-one / packages / neo-one-website / src / pages / tutorial.tsx View on Github external
export default () =&gt; {
  const props = useRouteData();

  return (
    &lt;&gt;
      
      }&gt;
        
          
        
      
    
  );
};
github neo-one-suite / neo-one / packages / neo-one-website / src / pages / reference.tsx View on Github external
export default () =&gt; {
  const props = useRouteData();

  return (
    &lt;&gt;
      
      }&gt;
        
          
        
      
    
  );
};
github react-static / react-static / packages / react-static / templates / basic / src / containers / Post.js View on Github external
export default function Post() {
  const { post } = useRouteData()
  return (
    <div>
      {'&lt;'} Back
      <br>
      <h3>{post.title}</h3>
      <p>{post.body}</p>
    </div>
  )
}
github 1productaweek / webframe / src / pages / products.js View on Github external
export default function Categories () {
  const { products } = useRouteData()
  return (
    
      
      <h2>Products</h2>
      <div>
        
          {(products || []).map(prod =&gt; (
            
              
            
          ))}
        </div>
github neo-one-suite / neo-one / packages / neo-one-website / src / pages / blog.tsx View on Github external
export default () =&gt; {
  const props = useRouteData();

  return (
    &lt;&gt;
      
      }&gt;
        
          
        
      
    
  );
};
github neo-one-suite / neo-one / packages / neo-one-website / src / pages / blogAll.tsx View on Github external
export default () =&gt; {
  const props = useRouteData();

  return (
    &lt;&gt;
      }&gt;
        
        
          
        
      
    
  );
};