Skip to content

React hooks#123

Open
coderIvanTS wants to merge 6 commits into
spirit-drive:mainfrom
coderIvanTS:ReactHooks
Open

React hooks#123
coderIvanTS wants to merge 6 commits into
spirit-drive:mainfrom
coderIvanTS:ReactHooks

Conversation

@coderIvanTS
Copy link
Copy Markdown

No description provided.

</button>
</div>
)
} else {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Тут не нужен так как если выполнится if то сработает return и ф-ия завершит свое выполнение

setCurrentLang(e.target.value as CURRENT_LANGUAGE);
}
return (
<>
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

<> лишнее

onClose: () => void;
}

export const Modal = (props: PropsWithChildren<IModal>) => {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Примените паттерн диструктуризация пропсов это считается хороший тоном

onDeleteFromCart: () => void;
}

export const ProductInCart = ({ productName, onDeleteFromCart }: IProductInCart) => {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Вот тут хороший тон))))

console.log('Test ' + JSON.stringify(s.button.height))
console.log('start theme ');
const { theme, toggleTheme, setTheme } = useThemeContext();
console.log('theme ' + JSON.stringify(theme));
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

стоит не забывать чистить логи

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