6

我刚刚更新到最新的 expo sdk 33,所以我可以使用 expo web 功能。该项目似乎正在运行,我可以导航到不同的屏幕,但我可以在任何屏幕上滚动。有谁知道我可能做错了什么或错过了什么?

Expo-cli 版本是:'2.19.5'

我正在使用纱线

包.json

{
  "main": "node_modules/expo/AppEntry.js",
  "scripts": {
    "start": "expo start",
    "android": "expo start --android",
    "ios": "expo start --ios",
    "eject": "expo eject"
  },
  "dependencies": {
    "@expo/vector-icons": "latest",
    "expo": "next",
    "expo-cli": "^2.19.5",
    "expo-codemod": "^1.0.0",
    "expo-constants": "latest",
    "expo-image-manipulator": "latest",
    "expo-image-picker": "latest",
    "expo-intent-launcher": "latest",
    "expo-permissions": "latest",
    "firebase": "^5.8.1",
    "native-base": "^2.12.1",
    "react": "16.8.3",
    "react-dom": "^16.8.6",
    "react-firebaseui": "^3.1.2",
    "react-native": "https://github.com/expo/react-native/archive/sdk-33.0.0.tar.gz",
    "react-native-alert-async": "^1.0.3",
    "react-native-modal": "^9.0.0",
    "react-native-modal-datetime-picker": "^6.0.0",
    "react-native-picker-select": "^5.2.3",
    "react-native-web": "^0.11.4",
    "react-navigation": "^3.5.0-alpha.0",
    "react-redux": "^6.0.0",
    "redux": "^4.0.1",
    "redux-thunk": "^2.3.0",
    "rxjs": "^6.3.3",
    "schedule": "0.4.0",
    "uuid": "^3.3.2"
  },
  "devDependencies": {
    "babel-preset-expo": "^5.0.0",
    "prettier": "1.16.4"
  },
  "prettier": {
    "jsxBracketSameLine": true,
    "arrowParens": "always",
    "bracketSpacing": false
  },
  "private": true
}

应用程序.js

    const AppContainer = createBrowserApp(AppNavigator);
    type Props = {};

export default class App extends Component<Props> {
  render() {
    const store = createStore(reducers, {}, applyMiddleware(ReduxThunk));

    return (
      <Provider store={store}>
        <AppContainer
          onNavigationStateChange={(prevState, currentState) => {
            const currentScreen = getActiveRouteName(currentState);
            const prevScreen = getActiveRouteName(prevState);
          }}
          ref={(navigatorRef) => {
            NavigationService.setTopLevelNavigator(navigatorRef);
          }}
        />
      </Provider>
    );
  }
}
4

1 回答 1

0

解决了这个用 ScrollView 包装我的主视图的问题

<ScrollView>
  <View>
  </View>
</ScrollView>
于 2022-01-30T14:31:50.200 回答