对于这个错基本网上的方案都是this指向问题,由于本人用的hooks,来写类似抖音的页面,所以我这里必须用useRef 接收一下,下面是写法
export default function HomeListPage(props:any) {
const [listData, setListData] = useState([0, 1, 2]);
const renderItem = ({
item, index}) => {
return (
对于这个错基本网上的方案都是this指向问题,由于本人用的hooks,来写类似抖音的页面,所以我这里必须用useRef 接收一下,下面是写法
export default function HomeListPage(props:any) {
const [listData, setListData] = useState([0, 1, 2]);
const renderItem = ({
item, index}) => {
return (