diff --git a/src/renderers/Form/UUID.tsx b/src/renderers/Form/UUID.tsx index a1a88cd51..e4e7a6267 100644 --- a/src/renderers/Form/UUID.tsx +++ b/src/renderers/Form/UUID.tsx @@ -20,6 +20,19 @@ export default class UUIDControl extends React.Component< > { constructor(props: FormControlProps) { super(props); + if (!props.value) { + this.setValue(); + } + } + + componentDidUpdate(props: FormControlProps) { + if (!props.value) { + this.setValue(); + } + } + + setValue() { + const props = this.props; let uuid = uuidv4(); if (props.length) { uuid = uuid.substring(0, props.length);