score:9

Accepted answer
{items.map((item, i) => (
    <div key={i}>
        <TextField onChange={e => updateItem('name', e, i)}/>
        <TextField onChange={e => updateItem('quantity', e, i)}/>
        <TextField onChange={e => updateItem('unit', e, i)}/>
    </div>
))}

score:0

// in reducer file
 case 'SAVE_SERVICE_STATE': {
      return {
        ...state,
        service: {...payload},
        loading: false,
      };
    } 

//listen service state change
  useEffect(() => {
    if (props.serviceState) {
      // do something
    }
  }, [props.serviceState]);

Related Query

More Query from same tag