How to set initial value on screen load
See original GitHub issueHi, how to set value initial value on screen load, as below example, Need to set “BSNL” as default value
If data(items) is pulled from API, using useEffect and once data pulled successfully we set value to second last value like below example
const [open, setOpen] = useState(false);
const [value, setValue] = useState(null);
const [items, setItems] = useState([
{ value: 'Airtel', label: 'Airtel' },
{ value: 'BSNL', label: 'BSNL' },
{ value: 'VI', label: 'VI' }
]);
useEffect(() => {
// data taken from api
setItems(data);
}, []);
<DropDownPicker items={items} open={open} setOpen={setOpen} value={value} setValue={setValue} />
Issue Analytics
- State:
- Created 2 years ago
- Comments:9 (3 by maintainers)
Top Results From Across the Web
Set default values for fields or controls - Microsoft Support
Right-click the control that you want to change, and then click Properties or press F4. Click the All tab in the property sheet,...
Read more >Android Preferences: How to load the default values when the ...
I have set all the android:defaultValue="" for them. When I start my application, I need the preferences, or if they are not set...
Read more >getting default values in module pool screen - SAP Community
Hi,. When you create the screen...jus double click on the field.There One option will be there : TEXT. There you can give your...
Read more >Set Default Value of Epicor Fields With Screen Customization
The first step is to open the form you would like to set the default value in using developer mode. When you are...
Read more >Set Default Values in Power Apps - SharePoint - YouTube
This video is a step-by-step tutorial on how to set the default values of controls in Power Apps. We will set default values...
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 Free
Top 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

@hossein-zare That deoesn’t seem to work for me…I set Value and it’s always showing as “select an item”
`
`
try JSON.stringify for value