How to use useScrollTo with ReactWebChat for a react based chat application
I have a question
I have a chat application, in which we render the chat using ReactWebChat . Now I want that, when a message comes from the bot, we scroll to top of that message and not to end like the default behaviour.
I want to use the useScrollTo hook for this purpose, but I am getting error that says :-
This hook can only be used inside the descendent of a <Composer>
How can I use the useScrollTo hook along with ReactWebChat to achieve the required behaviour?
I was able to do it in a different manner.
I was setting StyleOptions when using ReactWebChat . I wanted to prevent the default scroll to bottom, hence I used the autoScrollSnapOnPage and autoScrollSnapOnPageOffset.
Please advise if this is a correct approach.
@swarnava112 - Are you still have an issue with this?
Closing due to inactivity.