简体   繁体   中英

I got `Uncaught TypeError: _this.ref.querySelector is not a function` while using semantic ui react dropdown

I'm using the dropdown menu Floation component, but I got this error

Uncaught TypeError: _this.ref.querySelector is not a function

here's the full error stack:

在此处输入图片说明

and here's my code

<Button.Group color="teal">
  <Button>Save</Button>
  <Dropdown
    as={Button}
    className="icon"
    options={[
      { key: 'edit', icon: 'edit', text: 'Edit Post', value: 'edit' },
      {
        key: 'delete',
        icon: 'delete',
        text: 'Remove Post',
        value: 'delete',
      },
      { key: 'hide', icon: 'hide', text: 'Hide Post', value: 'hide' },
    ]}
    trigger={<div ref={ref => (this.input = ref)} />}
  />
</Button.Group>

I had the same problem:

I was using v0.83 and after updating to the latest version 0.86 everything works fine.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM