webpackJsonp([63755527096828],{987:function(e,t){e.exports={pathContext:{action:"https://codepen.io/pen/define",payload:'{"editors":"0010","html":"<div id=\\"root\\"></div>","js":"class ScrollingList extends React.Component {\\n  listRef = null;\\n\\n  // highlight-range{1-10}\\n  getSnapshotBeforeUpdate(prevProps, prevState) {\\n    // Are we adding new items to the list?\\n    // Capture the scroll position so we can adjust scroll later.\\n    if (prevProps.list.length < this.props.list.length) {\\n      return (\\n        this.listRef.scrollHeight - this.listRef.scrollTop\\n      );\\n    }\\n    return null;\\n  }\\n\\n  // highlight-range{1-8}\\n  componentDidUpdate(prevProps, prevState, snapshot) {\\n    // If we have a snapshot value, we\'ve just added new items.\\n    // Adjust scroll so these new items don\'t push the old ones out of view.\\n    // (snapshot here is the value returned from getSnapshotBeforeUpdate)\\n    if (snapshot !== null) {\\n      this.listRef.scrollTop =\\n        this.listRef.scrollHeight - snapshot;\\n    }\\n  }\\n\\n  render() {\\n    return (\\n      <div ref={this.setListRef}>\\n        {/* ...contents... */}\\n      </div>\\n    );\\n  }\\n\\n  setListRef = ref => {\\n    this.listRef = ref;\\n  };\\n}\\n","js_external":"//unpkg.com/react/umd/react.development.js;//unpkg.com/react-dom/umd/react-dom.development.js","js_pre_processor":"babel","layout":"left"}'}}}});
//# sourceMappingURL=path---redirect-to-codepen-update-on-async-rendering-react-dom-properties-before-update-after-fefc9b92e75a298ae040.js.map