7 Matching Annotations
- Jan 2021
-
legacy.reactjs.org legacy.reactjs.org
-
The alternative is uncontrolled components, where form data is handled by the DOM itself.
-
In a controlled component, form data is handled by a React component.
-
- Oct 2020
-
github.com github.com
-
In general it is recommended you handle forms in this "controlled" manner. In some cases it might make sense to manage the form state outside of Solid via refs. These "uncontrolled" forms can also work. Just be conscious of the difference as mixing approaches can lead to unexpected results.
-
- Nov 2019
-
-
The terms “controlled” and “uncontrolled” usually refer to form inputs, but they can also describe where any component’s data lives. Data passed in as props can be thought of as controlled (because the parent component controls that data). Data that exists only in internal state can be thought of as uncontrolled (because the parent can’t directly change it).
-
- Oct 2019
-
github.com github.com
-
However, if more control is needed, you can pass any of these pieces of state as a prop (as indicated above) and that state becomes controlled. As soon as this.props[statePropKey] !== undefined, internally, downshift will determine its state based on your prop's value rather than its own internal state.
-
- Sep 2019
-
github.com github.com
-
You can control the following props by providing values for them. If you don't, react-select will manage them for you. value / onChange - specify the current value of the control menuIsOpen / onMenuOpen / onMenuClose - control whether the menu is open inputValue / onInputChange - control the value of the search input (changing this will update the available options) If you don't provide these props, you can set the initial value of the state they control: defaultValue - set the initial value of the control defaultMenuIsOpen - set the initial open value of the menu defaultInputValue - set the initial value of the search input
Example of having props for both ways: value or defaultValue, depending on whether you want it to be controlled or not.
-