-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Closed
Description
Trying to integrate react-select into our application and we're seeing the following error. There may be something in our workflow that is causing it. We're using ReactDOM to render react components into our page.
Uncaught Error: Invariant Violation: addComponentAsRefTo(...): Only a ReactOwner can have refs. You might be adding a ref to a component that was not created inside a component's `render` method, or you have multiple copies of React loaded (details: https://fb.me/react-refs-must-have-owner).
An example:
// other code
function init() {
model.on('change', renderRecipientDisplay);
}
function logChange(val) { console.log("Selected: " + val); }
function renderRecipientDisplay() {
var ReactSelect = require('react-select');
var options = [{ value: 'one', label: 'One' }, { value: 'two', label: 'Two' }];
ReactDOM.render(
(
<ReactSelect name="form-field-name" value="one" options={options} onChange={logChange} />
),
$el.find('.routing-recipient-display')[0]
);
}hyzhak, faysalhaque, chriddyp, tomasPavlacky, leiming and 14 more
Metadata
Metadata
Assignees
Labels
No labels