Skip to content
This repository has been archived by the owner on Aug 7, 2024. It is now read-only.

Fix: Memoize user profile for performance improvement #5158

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions components/user/UserProfile.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useState } from "react";
import React, { useState } from "react";
import ReactMarkdown from "react-markdown";
import { MdQrCode2 } from "react-icons/md";
import { QRCodeSVG } from "qrcode.react";
Expand All @@ -9,9 +9,10 @@ import Tag from "../Tag";
import Link from "../Link";
import Badge from "../Badge";

export default function UserProfile({ BASE_URL, data }) {
function UserProfile({ BASE_URL, data }) {
const [qrShow, setQrShow] = useState(false);
const fallbackImageSize = 120;

return (
<>
<div className="flex justify-center items-center flex-col md:flex-row gap-x-6">
Expand Down Expand Up @@ -76,3 +77,5 @@ export default function UserProfile({ BASE_URL, data }) {
</>
);
}

export default React.memo(UserProfile);