Select.Async error with 1.0.0-rc.10
See original GitHub issueOur app is React + Redux + Redux Form with heavy use of react-select, particularly the Async version.
After updating from rc.9 to rc.10, we’re getting an error in existing code. Here’s a sample (sorry, Plunkr is blocked for me at work):
const getTenantList = (searchString) => {
return new Promise((resolve, reject) => {
resolve({
options: [
{ value: 'bob', label: 'BOB' },
{ value: 'john', label: 'JOHN' }
]
});
});
};
...
<Select.Async
name="tenant"
value={{ value: '', label: '' }}
loadOptions={getTenantList}
/>
If I remove the Async, it works as expected (empty dropdown), but if I put it back, I get the following warning and error:
Warning: React.createElement: type is invalid – expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it’s defined in. Check the render method of
ServiceDefinitionsForm
. in ServiceDefinitionsForm (created by Form(ServiceDefinitionsForm)) in Form(ServiceDefinitionsForm) (created by Connect(Form(ServiceDefinitionsForm))) in Connect(Form(ServiceDefinitionsForm)) (created by ReduxForm) in ReduxForm (created by Connect(ReduxForm)) in Connect(ReduxForm) (created by ServiceDefinitions) in div (created by ModalBase) in div (created by Modal)Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it’s defined in. Check the render method of
ServiceDefinitionsForm
.
As stated, this works fine in rc.9. Any guidance would be much appreciated.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:5
- Comments:7 (1 by maintainers)
Top GitHub Comments
Same issue here when updating to rc.10, using this
where
props.domains
is an array of objects loaded asynchronously with Redux.I get the same error as garretmurphy with
object
instead ofundefined
.Warning: React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: object.
In rc6 it suddenly changed its module export. The ReactSelect component is now exposed under ‘default’ export. This doesnt match the typescript typings in @types/react-select. Not sure if this an intended change though.