Skip to content

Uncaught Error: Element type is invalid #220

Open
@oosby

Description

I'm using react-flatpickr in a functional react component and getting the following error in the browser
Uncaught Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: object.
This is how it's implemented:

function MyApp() {
...
return (
      <Flatpickr
        className={classes}
        value={date}
        options={options}
        onChange={handleChange}
        onOpen={handleOpen}
        onClose={handleClose}
      >
        <input type='text' data-input placeholder={placeholder} />
        <button type='button' data-toggle className='calendar-icon'>
        </button>
      </Flatpickr>
   )}

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions