import React from "react"; import { DocStringComponent } from "./DocStringComponent"; import { GenericComponent } from "./GenericComponent"; import { LevelName } from "./NotificationsComponent"; import { SerializedObject } from "../types/SerializedObject"; import useRenderCount from "../hooks/useRenderCount"; import useSortedEntries from "../hooks/useSortedEntries"; interface DictComponentProps { value: Record; docString: string | null; isInstantUpdate: boolean; addNotification: (message: string, levelname?: LevelName) => void; id: string; } export const DictComponent = React.memo((props: DictComponentProps) => { const { docString, isInstantUpdate, addNotification, id } = props; const sortedEntries = useSortedEntries(props.value); const renderCount = useRenderCount(); return (
{process.env.NODE_ENV === "development" &&
Render count: {renderCount}
} {sortedEntries.map((item) => { return ( ); })}
); }); DictComponent.displayName = "DictComponent";