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

HW7 Navruzov #86

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

HW7 Navruzov #86

wants to merge 1 commit into from

Conversation

lfnickname
Copy link

No description provided.

import { useState } from 'react';

const App = () => {
const [name, setName] = useState('Andrey');
const [currency, setCurrency] = useState('USD');
Copy link
Owner

Choose a reason for hiding this comment

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

Я говорил о том, что не стоит всю логику и данные контекста хранить в состоянии нашего приложения. Покажу как это можно сделать удобнее на своей домашке.

@@ -25,7 +26,12 @@ function BasketItem({
<span className={styles.count}>{amount}</span>
<Button onClick={increment} icon="plus" secondary small />
</div>
<p className={cn(styles.count, styles.price)}>{subtotal} $</p>
<p className={cn(styles.count, styles.price)}>
<CurrencyConsumer>
Copy link
Owner

Choose a reason for hiding this comment

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

не очень удобный вариант использования, покажу, как это можно сделать удобнее

return <Loader />;
}
if (fetchValue === 'ok') {
ordersSelector = {};
Copy link
Owner

Choose a reason for hiding this comment

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

не совсем понимаю что это? в селектор что-то присваивать?

Copy link
Author

Choose a reason for hiding this comment

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

Обнуляю basket

Copy link
Owner

Choose a reason for hiding this comment

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

это так не работает, все изменения в редаксе происходят через диспатч екшенов

@@ -5,6 +5,8 @@ import Review from './review';
import Loader from '../loader';
import ReviewForm from './review-form';
import styles from './reviews.module.css';
import { CSSTransition, TransitionGroup } from 'react-transition-group';
import './reviews.css';
Copy link
Owner

Choose a reason for hiding this comment

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

необходимо было сделать вариант через css modules

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.

2 participants