Could someone help me with checking for null while destructuring data?
const {
vehicles: {
data: { reminderVehicles },
},
} = useSelector((state) => state);
The code snippet above is throwing an error message:
Attempting to access vehicles.data.reminderVehicles but it's null
document.getElementById("VehicleRegistration").value = "${
(prepopVehicleReg && reminderVehicles[0]?.Registration) || ""
}";