Comments (7)
@furqanZafar but you also have the case where if you omit a value="apple"
, the value is not nothing, but still changeable by a user, and onChange
events are still fired.
Its more like, the prop is the optional source, but if it is omitted, the component assumes manages it instead.
At least, that is my understanding of how it should be. I'm still investigating whether this is actually the case.
from react-select.
@dcousens @furqanZafar I believe this is still an issue - renders it difficult to use this component.. When utilising setState on any event it would trigger a render of the component..
from react-select.
I ended up writing a whole new component that is completely stateless and avoids synchronisation of props with state.
It uses state for a particular value only if the user does not provide that value via props, otherwise it uses the value directly from props. This overcomes the problem stated by @dcousens, And makes it easier to maintain & add features.
https://github.com/furqanZafar/react-selectize
from react-select.
@furqanZafar Thanks for sharing that, really nice piece of work - should put it out there, its very well written and overcomes the problems and anti-pattern used with react-select.
from react-select.
Really nice component @furqanZafar
I've not seen Livescript before either :)
from react-select.
Thanks!
Livescript has really helped speed up development time & improve code readability, one of the objectives of react-selectize is to raise awareness about how well Livescript gels with ReactJS due there functional nature.
Livescript is pretty, concise with rich syntax sugar, some of which just recently started appearing in ES6 such as destructuring (or pattern matching), enhanced object literals, template strings, classes & much more...
from react-select.
this is resolved in v2, we now maintain a separate stream for controlled props and internally managed state values. Please see the following docs for details.
from react-select.
Related Issues (20)
- MenuPortal placement is off for position='fixed' if a parent has transform: scale
- Cannot select options on iOS with VoiceOver since 5.8.0 HOT 1
- MS Edge 119: text cut in placeholder/selected option HOT 1
- Name property is not defined for option in the animation color dropdown.
- autoComplete overlaps the input field on v5 HOT 1
- <title> OMG HOT 1
- react-select v5.8.0: `Extra attributes from the server: aria-activedescendant` HOT 3
- Async multi select options are reset after selecting an option HOT 2
- Issue with input type="number" on Firefox/Safari HOT 2
- Menu is closing inside tests HOT 4
- Validation works incorrectly for React-select with Formik and yup on mobile device
- JAWS screen reader highlight/focus issue
- Bug: right clicking on a select input when the menu is open makes the input unresponsive
- Inconsistent Behavior With Magnification When Selecting Dropdowns
- Inconsistent Behavior With Magnification When Selecting Dropdowns
- Pressing on Tab key takes me to outside of the form instead of next input. HOT 9
- <withAsyncPaginate: the options menu closes on every option click>
- The issue where the keyboard's down button does not work immediately during Korean input
- Extra Space in Dropdown Menu of React Select Component on Initial Render
- not showing the inital value HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-select.