Below is my source code
EDTIComp.tsx
function SentenceBuild(props: {
form: FormHook<EditMedicationForm.EditMedicationFormStructure>;
fieldPath: EditMedicationForm.InstructionFields;
defaultValue: string;
useDefaultValue: boolean;
readOnly?: boolean;
}) {
const startsOn = moment(instruction.startsOn, ValidDateFormats.NodeDateTimeTimezone);
let showStartsOn = false;
if (startsOn && startsOn.isValid()) {
showStartsOn = moment().endOf('day').isBefore(startsOn, 'day');
return (
<div data-test-id={'sentence-builder'} className={styles.sentenceBuilder}>
{showStartsOn && (
<SentenceItem
prefix='starting on'
readOnly={props.readOnly}
value={moment(startsOn).format(ValidDateFormats.Edit)}
default='[date]'
/>
)}
</div>
);
}
EDSF.tsx
const performedOnMoment = Here I want to showStartsOn value