Hw 10#14
Open
AntonV1211 wants to merge 7 commits into
Open
Conversation
zubkov7
reviewed
Jun 23, 2025
zubkov7
reviewed
Jun 23, 2025
zubkov7
reviewed
Jun 23, 2025
zubkov7
reviewed
Jun 23, 2025
zubkov7
reviewed
Jun 23, 2025
zubkov7
reviewed
Jun 23, 2025
zubkov7
reviewed
Jun 23, 2025
zubkov7
reviewed
Jun 23, 2025
zubkov7
reviewed
Jun 23, 2025
zubkov7
reviewed
Jun 23, 2025
zubkov7
reviewed
Jun 23, 2025
zubkov7
reviewed
Jun 23, 2025
zubkov7
reviewed
Jun 23, 2025
zubkov7
reviewed
Jun 24, 2025
|
|
||
| useEffect(() => { | ||
| if (restaurant && location.pathname === `/restaurants/${restaurantId}`) { | ||
| React.useEffect(() => { |
There was a problem hiding this comment.
лучше импортировать напрямую useEffect, так будет лучше работать tree shaking
zubkov7
reviewed
Jun 24, 2025
| // Сброс формы при смене режима | ||
| useEffect(() => { | ||
| if (!isEditing) onCancelEdit?.(); | ||
| }, [editingReview]); |
zubkov7
reviewed
Jun 24, 2025
Comment on lines
+19
to
+22
| React.useEffect(() => { | ||
| setText(initialValues.text || ''); | ||
| setRating(initialValues.rating || 1); | ||
| }, [initialValues]); |
There was a problem hiding this comment.
для чего нужно? задается в initial value для состояния
There was a problem hiding this comment.
почему решили вместо useReducer использовать?
zubkov7
reviewed
Jun 24, 2025
| const review = useSelector(state => selectReviewById(state, reviewId)); | ||
| const user = useSelector(state => selectUserById(state, review?.userId)); | ||
| export const Review = ({ review, userId, onEdit }) => { | ||
| const { data: users } = useGetUsersQuery(); |
There was a problem hiding this comment.
нужно грузить в родителе, чтобы каждый отзыв не инициализировал запрос
zubkov7
approved these changes
Jun 24, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.