title: How to get user details of user from randomuser API?
body: <p>In a React assignment, I am trying to get the user details from randomuser.me API and show it on another component. Everything is done except unable to get user details from its id</p>
  <p>AdminPanel.js</p>
  <pre><code>&lt;TableBody&gt;
            {results.map((person) =&gt; (
  
              &lt;TableRow key={person.id.value}&gt;
                  &lt;TableCell component=&quot;th&quot; scope=&quot;row&quot;&gt;{person.name.first}&lt;/TableCell&gt;
                  &lt;TableCell align=&quot;right&quot;&gt;{person.name.last}&lt;/TableCell&gt;
                  &lt;TableCell align=&quot;center&quot;&gt;{person.location.street.name + ',' + person.location.street.number + ',' + person.location.state + ',' + person.location.country  }&lt;/TableCell&gt;
                  &lt;TableCell align=&quot;right&quot;&gt;&lt;img src={person.picture.thumbnail} /&gt;&lt;/TableCell&gt;
                  &lt;TableCell align=&quot;center&quot;&gt;{person.email}&lt;/TableCell&gt;
                  &lt;TableCell align=&quot;right&quot;&gt;{person.dob.date}&lt;/TableCell&gt;
                  &lt;TableCell align=&quot;right&quot;&gt;
                  &lt;Button variant=&quot;contained&quot; color=&quot;primary&quot; &gt;
                      &lt;Link style={{color:'white'}} to={`/user-detail/${person.login.uuid}`}&gt;View Details&lt;/Link&gt;
                  &lt;/Button&gt;
                  &lt;/TableCell&gt;
              &lt;/TableRow&gt;
  
            ))}
  &lt;/TableBody&gt;
  </code></pre>
  <p>After clicking on link it redirects to another page as</p>
  <p>UserDetail</p>
  <pre><code>import React, {useEffect} from 'react'
  import { useParams } from 'react-router-dom';
  
  export const UserDetail = () =&gt; {
      const {userid} = useParams()
  
      useEffect(() =&gt; {
          fetch(`/user-detail/${userid}`).then(res=&gt;res.json()).then(result=&gt; {
              console.log(result)
          })
  
      }, [])
      return (
          &lt;div&gt;
              
          &lt;/div&gt;
      )
  }
  </code></pre>
  <p>Bu, when console log shows this error 'Uncaught (in promise) SyntaxError: Unexpected token &lt; in JSON at position 0'</p>
  <p>What mistake I'am doing?</p>
  <p><a href="https://i.stack.imgur.com/VWUfy.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/VWUfy.png" alt="enter image description here" /></a></p>