React Arrow Function Component - setState is not defined
To implement stateful logic inside functional components use hooks
:
const AddAssetActivity = props => {
let { variations, slots, priceStructure } = props;
const [state, setState] = React.useState({
selectedSlot: { "0": "00", "1": "11" },
cal: 1
})
let handleChange = (event, value) => {
const _state = {...state}
let selectedSlot = _state.selectedSlot;
selectedSlot[value.variation] = value.slot;
setState({ ..._state, selectedSlot });
};
return (
<div>
</div>
);
};