React-select: Triggering open throws errors about undefined props

Created on 20 Nov 2018  路  1Comment  路  Source: JedWatson/react-select

I'm putting together what I consider to be a very simple use case, but running into errors when trying to click on my Select control.

I've put together a sandbox here: https://codesandbox.io/s/209j8v287r

Click on the select control. Note that it throws an error:

this.props.onMenuOpen is not a function. (In 'this.props.onMenuOpen()', 'this.props.onMenuOpen' is undefined)

Am I doing something wrong?

Most helpful comment

Found the issue. I was importing Select like this:

import Select from "react-select/lib/Select";

changing to this fixed it.

import Select from "react-select";

>All comments

Found the issue. I was importing Select like this:

import Select from "react-select/lib/Select";

changing to this fixed it.

import Select from "react-select";
Was this page helpful?
0 / 5 - 0 ratings