You'll want to understand this auto-scroll behavior in react

preview_player
Показать описание

Рекомендации по теме
Комментарии
Автор

Hey, you can use a column-reverse flex to achieve the same thing, and it will keep your scroll position if you have scrolled up :)

twiggeh
Автор

In the real world example will be a better to not force the user to scroll down with every new message came up, but you have to create a scroll down button with badge show how many messages are not readed yet.

خالد-شلذ
Автор

this will be very helpful for the code racer project!!! love the content keep up the consistency

acelaox
Автор

I don't create a new element but I create ref to the scroller to perform the scroll. I do it with a hook and the hook will also detect if the user perform scroll then the auto scroll will be pause until they scroll or click back to bottom.

yijinglow
Автор

Great content as always, thanks for sharing!

alexandrepereira
Автор

Hey But what if I am trying to interrupt the scroll when user is scrolling up?
How can I do that?

infomania_by_ayush
Автор

Do you need to have the if statement? Wont it automatically scroll if messages changes?

eshw
Автор

Great content! Wanted to ask you - are you planning to review Effector? In my opinion the best state manager, that's actually splits UI and business logic in the app. Just wanted to hear your opinion and pros and cons of it and other state managers

DanilaAnisimov
Автор

I'm super n00b at this stuff :(
did he created a fake div & then made a function that positions the fake div in view every time new info was added to the array?

jcruz
Автор

Hey bro, can you share the extension you used for rewritting the variable name

webcoderspeed
Автор

I thought you where switching to Remix :P

ThomazMartinez
Автор

It would be annoying having the autoscroll if you are trying to read earlier messages.

gavinnoname