Nested List not working as expected, synthetic event returned for value instead of input value
Nested List Item seems to return React synthetic event as value instead of input value. For example
users[]
- 0
- fname (correct input value)
- lname (correct input value)
- friends
- fname (synthetic event as value)
Here is a simple repo case: https://codesandbox.io/s/boring-engelbart-fn0k7?fontsize=14&hidenavigation=1&theme=dark
Encountered the same issue, synthetic event got returned in the intermediate level of the hierarchical value object. However, the leaf level values are correct.
:propertyOptions: Array(2) 0: {dispatchConfig: null, _targetInst: null, _dispatchListeners: null, _dispatchInstances: null, nativeEvent: null, …} 1: {dispatchConfig: null, _targetInst: null, _dispatchListeners: null, _dispatchInstances: null, nativeEvent: null, …}
Besides, there are a bunch of "Warning: This synthetic event is reused for performance reasons." shown while List item changed. The warning comes out of the setValue method of valueUtil.
More follow-up: In the defaultGetValueFromEvent method, the synthetic event object is returned when event.target is null (which happens quite often in a form list) as shown below.
if (event && event.target && valuePropName in event.target) { return event.target[valuePropName]; } return event;
Not sure the exact reason why returns a synthetic event here in the end since a synthetic event will be recycled and not guaranteed safe to reference in an async way after dispatching.
+1 also experiencing this.