Thank you all for this thread! My colleague and I just discovered that the default_value
property is a Constant, not a Variable.
In other React forms I've built, the default value for a Select was preset in an associated Context. So the first time the Select was rendered, default_value
was set to the correct value.
But in my latest React form (a small modal), I'm passing the values for the form as props and then using a useEffect
to populate the associated Context. So the FIRST time the Select is rendered, default_value
is set to null
. Then when the Context is populated and the Select is supposed to be re-rendered, default_value
cannot be changed and thus the initial default value is not set.
The solution was ultimately simple: Use the value
property instead. But figuring out why default_value
didn't work like it did with my other forms took some time.
I'm posting this to help others in the community.