mirror of
https://github.com/System-End/site.git
synced 2026-04-19 19:45:07 +00:00
🚨 Add username to deps array
This commit is contained in:
parent
7207898245
commit
63bd41a0cf
1 changed files with 7 additions and 6 deletions
|
|
@ -4,13 +4,14 @@ import { trim } from 'lodash'
|
|||
|
||||
const Mention = memo(function Mention({ username }) {
|
||||
const [img, setImg] = useState(null)
|
||||
|
||||
useEffect(() => {
|
||||
try {
|
||||
fetch(`https://scrapbook.hackclub.com/api/profiles/${trim(username)}`)
|
||||
.then(r => r.json())
|
||||
.then(profile => setImg(profile.avatar))
|
||||
} catch (e) {}
|
||||
}, [])
|
||||
fetch(`https://scrapbook.hackclub.com/api/profiles/${trim(username)}`)
|
||||
.then(r => r.json())
|
||||
.then(profile => setImg(profile.avatar))
|
||||
.catch(e => console.error(e))
|
||||
}, [username])
|
||||
|
||||
return (
|
||||
<Link
|
||||
href={`https://scrapbook.hackclub.com/${username}`}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue