import React, { useEffect, useRef } from 'react'; import { emit_update } from '../socket'; import { Card, Image } from 'react-bootstrap'; import { DocStringComponent } from './DocStringComponent'; interface ImageComponentProps { name: string; parentPath: string; value: string; readOnly: boolean; docString: string; format: string; } export const ImageComponent = React.memo((props: ImageComponentProps) => { const renderCount = useRef(0); const { name, parentPath, value, docString, format } = props; useEffect(() => { renderCount.current++; }); return (
{name} {process.env.NODE_ENV === 'development' && (

Render count: {renderCount.current}

)} {/* Your component JSX here */} {format === '' && value === '' ? (

No image set in the backend.

) : ( )}
); });