const [activeAddtive, setActiveAddtive] = useState(["Моцарелла"]);
const addAdditionally = (addtive) => {
activeAddtive.includes(addtive)
? activeAddtive.splice(activeAddtive.indexOf(addtive), 1)
: activeAddtive.push(addtive);
// activeAddtive.includes(additionally)?console.log(1):console.log(0)
console.log(activeAddtive);
};
const addAdditionally = (addtive) => setActiveAddtive((currentAddtive) =>
currentAddtive.includes(addtive)
? currentAddtive.map((entry) => entry === addtive ? 1 : entry)
: [...currentAddtive, addtive]
);