在升级到最新版本的React-Native和Expo之前,此代码块已运行。正在使用的版本是 "expo": "^32.0.0"
。
我以前能够以编程方式移动Animated.ScrollView的子级,但现在不再能够这样做。这是我正在测试的测试代码块。
import React, { Component } from 'react'; import { StyleSheet, Text, View, Animated, TouchableOpacity, SafeAreaView, ScrollView } from 'react-native'; export default class App extends React.Component { constructor(props) { super(props); } handleMove = () => { this.scroller.getNode().scrollTo({ x: 200, y: 0, animated: false }); }; render() { return (); } } const styles = StyleSheet.create({ container: {} }); Open up App.js to start working on your app! { this.scroller = scroller; }} > Move
升级后,代码块不再适用于最新版本。我正在测试的当前版本是:
"dependencies": { "expo": "^34.0.1", "react": "16.8.3", "react-dom": "^16.8.6", "react-native": "https://github.com/expo/react-native/archive/sdk-34.0.0.tar.gz", "react-native-web": "^0.11.4" },
正确的做法是什么?
我添加了点心来说明我的问题。' https://snack.expo.io/@louis345/brave-banana