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

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

Web Dev Cody

10 месяцев назад

9,609 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

Eshw23
Eshw23 - 06.09.2023 19:23

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

Ответить
خالد
خالد - 06.09.2023 18:36

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.

Ответить
Danila Anisimov
Danila Anisimov - 06.09.2023 01:11

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

Ответить
Yi Jing Low
Yi Jing Low - 05.09.2023 20:25

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.

Ответить
Deadeye
Deadeye - 05.09.2023 19:58

I thought you where switching to Remix :P

Ответить
J Cruz
J Cruz - 05.09.2023 19:20

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?

Ответить
Twiggeh
Twiggeh - 05.09.2023 17:56

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 :)

Ответить
Caner Yıldız
Caner Yıldız - 05.09.2023 17:51

İf you want to scroll down smoothly you can add scrollIntoView({behavior:"smooth"})

Ответить
webcoderspeed
webcoderspeed - 05.09.2023 17:08

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

Ответить
🇳🇬 Emmanuel Odii
🇳🇬 Emmanuel Odii - 05.09.2023 16:58

Thanks bro!

Ответить
Alexandre Pereira
Alexandre Pereira - 05.09.2023 16:53

Great content as always, thanks for sharing!

Ответить
Tina Seibert
Tina Seibert - 05.09.2023 16:41

Good job babe!!!! Love ya

Ответить
Gavin NoName
Gavin NoName - 05.09.2023 16:29

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

Ответить
Acela?ox
Acela?ox - 05.09.2023 16:15

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

Ответить
Chetan Ram
Chetan Ram - 05.09.2023 16:15

Happy teacher's day!

Ответить
syed haider
syed haider - 05.09.2023 16:04

Very nice and handy. Thank you man.

Ответить