onMessageReceived for channelList in React

In React app, I have integrated the Channel and ChannelList. We have to display the browser notifications on messageReceived, how can we implement this function and need to add &remove the handler properly with . Would someone help me to achieve it?

Hey @satyanarayana_ruppa,

To verify, you’re looking for recommendations on how to show browser notifications when a new message is received via the onMessageReceived() handler?

Hi @Tyler, Sorry for the misunderstandings. I have code to show browser notifications, but I am not sure where to add the onMessageReceived handler when we use Channel and ChannelList UIKit components. but I could fix it by following below approach.

integrate sendbird in react app
render Channel&ChannelList components.
when sendbird sdk is ready(not undefined), add the handler in useEffect.

Thanks for your response