Rehydrating HTML Select on Component Mount

Scenario

If you’ve got some values in your state, and you’d like to indicate those on a Select when the component/page mounts, here’s a code snippet of how I did it.

<Select
    onChange={handleMonthChange}
    placeholder="mm"
    isRequired
    defaultValue={valueFromState || ""}
>
    {expiryMonths.map((month) => (
    <option key={month} value={month}>
        {month}
    </option>
    ))}
</Select>