首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >模块化反应-本机错误:不支持将minDist与activeOffsetX或activeOffsetY结合使用

模块化反应-本机错误:不支持将minDist与activeOffsetX或activeOffsetY结合使用
EN

Stack Overflow用户
提问于 2021-12-07 02:52:02
回答 1查看 281关注 0票数 0

我正在使用RN,并且有几个使用react-native-modalize库的项目,到目前为止没有出现任何问题。但这一次,我创建了一个新项目,并按照教程应用了react-native-modalize,但得到了一个类似于这幅图像的错误。

在这里,我的Login.js:

代码语言:javascript
复制
import React, {useRef} from 'react';
import {
  ImageBackground,
  StyleSheet,
  Text,
  TouchableOpacity,
  View,
} from 'react-native';
import {Modalize} from 'react-native-modalize';
import {login_bottom, login_top} from '../assets';
import {colors} from '../constants';

const Login = ({navigation}) => {
  const modalizeRef = useRef(null);
  const onPressLogin = () => {
    modalizeRef.current?.open();
  };

  return (
    <>
      <Modalize ref={modalizeRef}></Modalize>
      <View style={styles.container}>
        <View style={{flex: 1, justifyContent: 'space-around'}}>
          <ImageBackground
            source={login_top}
            style={{
              width: null,
              height: '100%',
            }}
          />
        </View>
        <View style={{flex: 1, justifyContent: 'space-around'}}>
          <View style={styles.containerLogin}>
            <TouchableOpacity style={styles.loginButton} onPress={onPressLogin}>
              <Text style={styles.loginButtonText}>LOGIN</Text>
            </TouchableOpacity>
          </View>
        </View>
        <View style={{flex: 1, justifyContent: 'space-around'}}>
          <ImageBackground
            source={login_bottom}
            style={{
              width: null,
              height: '105%',
            }}
          />
        </View>
      </View>
    </>
  );
};

在这里,我的index.js:

代码语言:javascript
复制
/**
 * @format
 */
import {AppRegistry} from 'react-native';
import App from './src/App';
import {name as appName} from './app.json';
import {gestureHandlerRootHOC} from 'react-native-gesture-handler';

AppRegistry.registerComponent(appName, () => gestureHandlerRootHOC(App));

在这里,我的MainActivity.java:

代码语言:javascript
复制
package com.backbone;

import com.facebook.react.ReactActivity;

import com.facebook.react.ReactActivityDelegate;
import com.facebook.react.ReactRootView;
import com.swmansion.gesturehandler.react.RNGestureHandlerEnabledRootView;

public class MainActivity extends ReactActivity {

  /**
   * Returns the name of the main component registered from JavaScript. This is
   * used to schedule
   * rendering of the component.
   */
  @Override
  protected String getMainComponentName() {
    return "BackBone";
  }

  @Override
  protected ReactActivityDelegate createReactActivityDelegate() {
    return new ReactActivityDelegate(this, getMainComponentName()) {
      @Override
      protected ReactRootView createRootView() {
        return new RNGestureHandlerEnabledRootView(MainActivity.this);
      }
    };
  }

}

这就是我的盲从:

代码语言:javascript
复制
    "react": "16.13.1",
    "react-native": "0.63.4",
    "react-native-gesture-handler": "^2.0.0",
    "react-native-modalize": "^2.0.12",
EN

回答 1

Stack Overflow用户

发布于 2021-12-23 11:01:25

react本机-modalize目前并不是用来支持v2的反应-本机-手势-处理程序.

在Github:https://github.com/jeremybarbet/react-native-modalize/pull/375上有一个公共关系开放

我们得等到这件事解决了。同时,您降低了您的反应本机手势处理程序版本的级别。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/70254380

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档