I'm working in react js and I want to develop notifications component which related to the account related activities. I have to display all the account related activities in the notifications list and sort them as a read and unread notifications.
so the my question is how to manage read and unread notification in react/ next js ?
Do I need to make it state or session storage ?
consider this is my notification list :
const notificationArray = [
{ id: 1, msg: 'one' },
{ id: 2, msg: 'two' },
{ id: 3, msg: 'three' },
{ id: 4, msg: 'four' },
{ id: 5, msg: 'five' },
];
And in the below list I have received one new notification :
const notificationArray = [
{ id: 1, msg: 'one' },
{ id: 2, msg: 'two' },
{ id: 3, msg: 'three' },
{ id: 4, msg: 'four' },
{ id: 5, msg: 'five' },
{ id: 6, msg: 'six' }
];