Relative Content

Tag Archive for reactjsreact-hooks

React radio input type and defaultChecked behaviour with useEffect()

I have a situation where I want to set the default value of a radio group as a side effect of a deferred call. However, it would appear that the defaultValue property is ignored on a state update, and I’m at a loss to understand why. Here is a simple example, which I ran through https://playcode.io/react: