Skip to content

Instantly share code, notes, and snippets.

@Gary-Ascuy
Last active January 7, 2021 05:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Gary-Ascuy/3673d721a773eaaf98292149935ebbd7 to your computer and use it in GitHub Desktop.
Save Gary-Ascuy/3673d721a773eaaf98292149935ebbd7 to your computer and use it in GitHub Desktop.
VSinder - Frontend/App.js
import React, { useState, useEffect } from 'react'
function Profile({ user }) {
return (
<div className='profile'>
<a className='name' href={user.github}>
<div>{user.name}</div>
</a>
<h4 className='role'>{user.role}</h4>
<p className='bio'>{user.bio}</p>
</div>
)
}
export function App() {
const [user, setUser] = useState({})
useEffect(async () => {
const url = '//localhost:3666/me'
const { data } = await axios.get(url)
setUser(data)
})
return (
<div className='app'>
<Profile user={user}></Profile>
</div>
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment