mirror of
https://github.com/ershisan99/DevToysWeb.git
synced 2025-12-16 20:49:23 +00:00
refactor: memoize configuration on export
This commit is contained in:
@@ -1,3 +1,6 @@
|
||||
import { memo } from "react";
|
||||
import equal from "react-fast-compare";
|
||||
|
||||
type Props = {
|
||||
icon: React.ReactNode;
|
||||
title: string;
|
||||
@@ -5,7 +8,7 @@ type Props = {
|
||||
control: React.ReactNode;
|
||||
};
|
||||
|
||||
export function Configuration({ icon, title, description, control }: Props) {
|
||||
function RawConfiguration({ icon, title, description, control }: Props) {
|
||||
return (
|
||||
<div className="flex h-16 items-center gap-6 rounded border bg-configuration px-4">
|
||||
{icon}
|
||||
@@ -21,3 +24,5 @@ export function Configuration({ icon, title, description, control }: Props) {
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export const Configuration = memo(RawConfiguration, equal);
|
||||
|
||||
Reference in New Issue
Block a user