You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
16 lines
447 B
16 lines
447 B
import React, {useEffect, useState} from "react"; |
|
import {useParams} from "react-router"; |
|
import UserService from "../service/UserService"; |
|
|
|
const UserProfile = (props) => { |
|
const params = useParams(); |
|
const [user, setUser] = useState(); |
|
|
|
useEffect(async () => { |
|
const user = await UserService.getUserByName(params.userId); |
|
setUser(user); |
|
}, []) |
|
return <h1>{user?.username}</h1> |
|
}; |
|
|
|
export default UserProfile;
|
|
|