title: React - Show details by ID in different page
body: <p>I'm making a basic portfolio with react, and I'm utilising props to display each project I made. The projects are displayed on the homepage through a card component. Once I click on the specific project, I would like to get the ID of the (clicked) project and display it's information such as name and category in a banner component which is subsequently displayed in the Project page. I'm just getting started with react so I'm quite confused as to how this works despite it probably being very simple.</p>
  <p>Home.js</p>
  <pre><code>function createCard(project) {
    return &lt;Card 
      key={project.id} 
      name={project.name}
      img={project.img}
    /&gt;
  }
  
  function Home() {
  
    return (
        &lt;div className=&quot;grid-container&quot;&gt;
           {projects.map(createCard)}  
         &lt;/div&gt;
        )
  }
  
  export default Home;
  </code></pre>
  <p>Projects.js</p>
  <pre><code>const projects = [
    {
      id: 1,
      name: &quot;Dissertation Project&quot;,
      img: thumb1,
      tech: [&quot;HTML&quot;, &quot;SCSS&quot;],
      category: [&quot;Web Development&quot;, &quot;Usability Testing&quot;]
    },
  
    {
      id: 2,
      name: &quot;Cinema Booking System&quot;,
      img: thumb2,
      tech: &quot;&quot;,
      category: [&quot;&quot;]
    }
  ]
  export default projects;
  </code></pre>
  <p>Banner.js</p>
  <pre><code>import React from 'react';
  import thumb from '../images/thumb-1.jpg';
  
  function Banner (props) {
    return(
      &lt;React.Fragment&gt;
        &lt;div class=&quot;project__banner&quot;&gt;
          &lt;h2 class=&quot;project__banner-heading&quot;&gt;{props.name}&lt;/h2&gt;
        &lt;/div&gt;
        &lt;div class=&quot;project__desc&quot;&gt;
          &lt;div class=&quot;project__desc--1&quot;&gt;{props.category[0]}&lt;/div&gt;
          &lt;div class=&quot;project__desc--2&quot;&gt;{props.category[1]}&lt;/div&gt;
        &lt;/div&gt;
      &lt;/React.Fragment&gt;
    )
  }
  
  export default Banner;
  </code></pre>
  <p>Project.js</p>
  <pre><code>import React from 'react';
  import Banner from '../Banner';
  
  function  Project () {
  
    return (
      &lt;React.Fragment&gt;
        &lt;Banner /&gt;
      &lt;/React.Fragment&gt;
      
    )
  }
  
  export default Project;
  </code></pre>
  <p>I hope this is somewhat clear. Any help would be greatly appreciated.</p>