hard20 pts · first answer countsreactrendering
Scrolling to a just-added message
After setMessages([...messages, msg]), the code scrolls to the last list item, but it scrolls to the previous one. Which API makes React update the DOM before the scroll line?
Discussion 0
Join free to post in the discussion.
Related questions
- Why React lists need keysFrontend Developer
- Input that ignores typingFrontend Developer
- Changing a prop inside a childFrontend Developer
- What JSX turns intoFrontend Developer
- A component written in lowercaseFrontend Developer
- Adding a CSS class in JSXFrontend Developer
- Returning two elementsFrontend Developer
- A stray 0 on the pageFrontend Developer