Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

solution #1674

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

AnatoliiLykhohodenko
Copy link

Copy link

@anstsot anstsot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checklist #1 and #3 are not satisfied

src/App.tsx Outdated
<div className="App">
<h1>Dynamic list of Goods</h1>
export const App: React.FC = () => {
const [preparedGoods, setPreparedGoods] = useState([] as Good[]);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const [preparedGoods, setPreparedGoods] = useState([] as Good[]);
const [preparedGoods, setPreparedGoods] = useState<Good[]>([]);

src/App.tsx Outdated
<button
type="button"
data-cy="all-button"
onClick={() => getAll().then(setPreparedGoods)}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

better to create separate functions

Suggested change
onClick={() => getAll().then(setPreparedGoods)}
onClick={onLoadAll}

Copy link

@YegorKorenkov YegorKorenkov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please check point 3 in checklist and try to handle request error

Copy link

@anstsot anstsot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good work, approving:sparkles:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants