//retrieve one document and save it to userDetails const [userDetails, setUserDetails] = useState('') db.collection('users').doc(id).get() .then(snapshot => setUserDetails(snapshot.data()))