velocity-react - animating scrollTop after component update
问题 I'm writing a simple "console" that shows messages in a chat-like manner. With messages appearing from the bottom, and moving up. I have the working code, but I'd like to animate the appearing messages by scrolling the container to the bottom each time a new "li" is added. Current code: import React from 'react'; import { render, findDOMNode } from 'react-dom'; export default React.createClass({ componentDidUpdate : function(){ var node = findDOMNode(this); node.scrollTop = node.scrollHeight;