We use Atlaskit for our UI and before using any Atlaskit component, we wrap it with a custom component (e.g., Textfield → XTextfield). When we wrap AsyncSelect, its loadOptions
prop is not called. This problem does not occur if we use AsyncSelect without wrapping or if the wrapper is located within the same file that we use it. How can I fix this?
// XAsyncSelect.jsx
import AsyncSelect from '@atlaskit/select';
const XAsyncSelect = (props) => <AsyncSelect {...props} />;
export default XAsyncSelect;
// AnotherComponent.jsx
import XAsyncSelect from '../components/XAsyncSelect';
//....
<XAsyncSelect
value={value}
onChange={handleChange}
loadOptions={loadOptions} // not called
isMulti
defaultOptions
/>
//....