import React from 'react'; // import { Spring, animated, config } from 'react-spring/renderprops'; import { Animation, presets } from '@douyinfe/semi-animation-react'; import './style.scss'; const COLORS = ['crimson', 'teal', 'coral', 'hotpink', 'skyblue', 'salmon', 'seagreen', 'peachpuff']; export default class App extends React.Component { state = { y: 0 }; el = React.createRef(); spring = React.createRef(); setY = () => { console.log('setY'); this.setState({ y: Math.round(Math.random() * 750) + 50 }); }; doScroll = (node, y) => { // eslint-disable-next-line eqeqeq if (node && y != null) { node.scrollTop = y; } }; // User interaction should stop animation in order to prevent scroll-hijacking // Doing this on onWheel isn't enough, but just to illustrate ... stop = () => this.spring.current.stop(); render() { const y = this.el.current ? this.el.current.scrollTop : 0; return (