Skip to content

Commit

Permalink
add missing highlight (#4598)
Browse files Browse the repository at this point in the history
  • Loading branch information
in-in committed Sep 10, 2023
1 parent 1c087cb commit 957aed6
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,7 @@ export default notificationsSlice.reducer
We want to mark these notifications as read whenever our `<NotificationsList>` component renders, either because we clicked on the tab to view the notifications, or because we already have it open and we just received some additional notifications. We can do this by dispatching `allNotificationsRead` any time this component re-renders. In order to avoid flashing of old data as this updates, we'll dispatch the action in a `useLayoutEffect` hook. We also want to add an additional classname to any notification list entries in the page, to highlight them:

```jsx title="features/notifications/NotificationsList.js"
// highlight-next-line
import React, { useLayoutEffect } from 'react'
// highlight-next-line
import { useSelector, useDispatch } from 'react-redux'
Expand Down

0 comments on commit 957aed6

Please sign in to comment.