Problem using react-select in Electron
See original GitHub issueHi,
I use this basic example in Electron
options = [
{ value: 'one', label: 'One' },
{ value: 'two', label: 'Two' }
];
logChange(val) {
console.log('Selected: ' + JSON.stringify(val));
this.setState({
value: val ? val.value : null
});
}
<ReactSelect
name="form-field-name"
options={this.options}
onChange={this.logChange}
value={this.state.value}
/>
and got the error
Uncaught Error: 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).
I found that the error appear when the value is set. If remove value then the display is correct but after select a value then the error appear again.
Issue Analytics
- State:
- Created 6 years ago
- Comments:7 (1 by maintainers)
Top Results From Across the Web
React styling - Overflow issues - Expo & Electron single workflow
I'm struggling with styling an element within react and being a complete newbie to the language would love some help from this awesome...
Read more >Components - React Select
React -Select allows you to augment layout and functionality by replacing the default components with your own, using the components property. These components ......
Read more >Error: Can't resolve 'react-select' with typescript-Reactjs
I found the issue having here. Issue is both @types/react-select and react-select added to the package.json. Namindu Sanchila 384. score:3.
Read more >Building Electron desktop apps with React using Codemagic
Learn how to create an Electron desktop app with React and build it with Codemagic. ... A select menu will be used to...
Read more >react select error handle Code Example
Answers related to “react select error handle” ... how to run electron and react using concurrently · how to run react app on...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hello, I had a similar error when working on a package that uses react-select with redux-form. After fixing the multiple version of react issue @acac99 mentions, I was still having this issue on single select fields.
I was able to fix the issue by setting joinValues={true} on my Select Component, which caused a different hidden input to be generated, and the error went away.
Hello -
In an effort to sustain the
react-select
project going forward, we’re closing old issues / pull requests.We understand this might be inconvenient but in the best interest of supporting the broader community we have to direct our limited efforts to maintain the latest version.
If you feel this issue / pull request is still relevant and you’d like us to review it, please leave a comment and we’ll do our best to get back to you.