Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ So the third button should count like this:
- Install Prettier Extesion and use this [VSCode settings](https://mate-academy.github.io/fe-program/tools/vscode/settings.json) to enable format on save.
- Implement a solution following the [React task guideline](https://github.com/mate-academy/react_task-guideline#react-tasks-guideline).
- Open one more terminal and run tests with `npm test` to ensure your solution is correct.
- Replace `<your_account>` with your Github username in the [DEMO LINK](https://<your_account>.github.io/react_counter-js/) and add it to PR description.
- Replace `<your_account>` with your Github username in the [DEMO LINK](https://n7lots.github.io/react_counter-js/) and add it to PR description.
11 changes: 5 additions & 6 deletions src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,22 @@ import { useState } from 'react';
import './App.scss';

export const App = () => {
const [count] = useState(0);
const [count, setCount] = useState(0);

const addOne = () => {
// write code here
setCount(currentCount => currentCount + 1);
};

const add100 = () => {
// write code here
setCount(currentCount => currentCount + 100);
};

// DON'T change the code below
const increase = () => {
addOne();

if (count % 5 === 0) {
add100();
}

addOne();
};

return (
Expand Down