import React, { useEffect, useRef } from 'react'; import { InputGroup, Form, Row, Col } from 'react-bootstrap'; import { emit_update } from '../socket'; import { DocStringComponent } from './DocStringComponent'; interface EnumComponentProps { name: string; parentPath: string; value: string; docString?: string; enumDict: Record; } export const EnumComponent = React.memo((props: EnumComponentProps) => { const renderCount = useRef(0); useEffect(() => { renderCount.current++; }); const { name, parentPath: parentPath, value, docString, enumDict } = props; const handleValueChange = (newValue: string) => { emit_update(name, parentPath, newValue); }; return (
{process.env.NODE_ENV === 'development' && (

Render count: {renderCount.current}

)} {name} handleValueChange(event.target.value)}> {Object.entries(enumDict).map(([key, val]) => ( ))}
); });