Hi all so basically I am using the react-select library to help streamline some select components I am using in my app. I am using state to keep track of the changes between the values. I am taking this value as well as others and submitting a form to firebase. The issue I am having is when I attempt to load and edit the data. I am currently loading in the field data from firebase and setting the current state to so that the form components display the values from firebase and can be edited. When doing this the data load into the text fields just fine, but the select component does not. I can see the value being passed but the select component doesn't recognize that value should be loaded as the currently selected option. Has anyone had a similar issue?
const [make, setMake] = useState("");
const carMakeOptions = [value: "ford", label: "Ford"
value: "toyota", label: "Toyota" ...........]
<Select defaultValue={make} defaultInputValue={make} options={carMakeOptions} onChange={(e) => {setMake(e.value)}}>
Loading in data from firebase and resetting state here:
setMake(carDocSnap.data().make);