Skip to content

bug: ion-datetime (and other components) throw instance[watchMethodName] is not a function when used inside inline IonModal (React) #30925

@nam-aepsy

Description

@nam-aepsy

Prerequisites

Ionic Framework Version

v7.x

Current Behavior

TypeError: instance[watchMethodName] is not a function
    at Datetime.set [as min]
    at attributeChangedCallback

Expected Behavior

Ionic components should not throw runtime errors when used inside IonModal, even when controlled via React props.

At minimum:
• setting props like min, value, or isOpen should be safe
• or Ionic should document that this pattern is unsupported

Steps to Reproduce

const Example = () => {
  const [open, setOpen] = useState(true);

  return (
    <IonModal isOpen={open}>
      <IonDatetime
        presentation="date"
        min="2026-01-19"
        value="2026-01-20"
      />
    </IonModal>
  );
};

Code Reproduction URL

null

Ionic Info

This affects multiple components that using Overlay

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    package: core@ionic/core packagestencilIssues that require changes in Stenciltype: buga confirmed bug report

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions