Sobes.tech
Back to tasks
Junior — Senior
33

Обнаружить и исправить баги в компоненте

Get help with live coding in real time with Sobes Copilot
Task condition

Найдите и устраните ошибки в приведённом ниже фрагменте JavaScript‑кода, реализующего простой счётчик.

 export default function Counter() {
    let count = 0;
}

const changeCount = () => {
    count += 1;
};

return {
    <div>
    <div>Count = {count}</div>

    <button onClick={changeCount}-Knomsa</button>
    </div>
};
}