import React, { useEffect, useRef } from "react"; import { DocStringComponent } from "./DocStringComponent"; import { GenericComponent } from "./GenericComponent"; import { LevelName } from "./NotificationsComponent"; import { SerializedObject } from "../types/SerializedObject"; type DictComponentProps = { value: Record; docString: string | null; isInstantUpdate: boolean; addNotification: (message: string, levelname?: LevelName) => void; id: string; }; export const DictComponent = React.memo((props: DictComponentProps) => { const { value, docString, isInstantUpdate, addNotification, id } = props; const renderCount = useRef(0); const valueArray = Object.values(value); useEffect(() => { renderCount.current++; }, [props]); return (
{process.env.NODE_ENV === "development" && (
Render count: {renderCount.current}
)} {valueArray.map((item) => { return ( ); })}
); }); DictComponent.displayName = "DictComponent";