uiwjs / react-native-uiw

A UI component library based on React Native (Android & iOS).
https://uimjs.github.io
MIT License
45 stars 26 forks source link

在packages中开发组件并且引用组件Modal时,打开modal有时候会颤抖 #305

Closed cuilanxin closed 1 year ago

cuilanxin commented 3 years ago

控制台输入如下

Could not locate shadow view with tag #5329, this is probably caused by a temporary inconsistency between native views and shadow views.

packages

import Modal,{ ModalProps } from '../Modal';

export interface ComonentsProps {
  visible?: boolean;
  /** modal 属性 */
  ModalProps?: ModalProps;
  /** 关闭模态框 */
  onClosed?: () => void;
}
const Comonents = (props) => {
  const { visible, onClosed, ModalProps, } = props;
  return (
    <Modal 
      placement="bottom"
      visible={visible}
      onClosed={onClosed}
      {...ModalProps}
    >
      <SafeAreaView>
        <Text>123</Text>
        <Text>123</Text>
        <Text>123</Text>
        <Text>123</Text>
        <Text>123</Text>
        <Text>123</Text>
        <Text>123</Text>
        <Text>123</Text>
      </SafeAreaView>
    </Modal>
  );
};

example

import {Comonents, Button} from '@uiw/react-native';
import React, {useState} from 'react'
const Demo = ()=>{
  const [visible, setVisible] = useState(false)
  return(
    <>
       <Button onPress={()=>{
              setVisible(true)
       }}>按钮</Button>
      <Comonents visible={visible} onClose={()=>setVisible(false)} />
    </>
  )
}
cuilanxin commented 2 years ago

https://user-images.githubusercontent.com/57083007/139517779-2a3440a4-e438-4cd1-ab9c-0ad62f786c6c.mov

cuilanxin commented 2 years ago

功能也会失效

ChenlingasMx commented 1 year ago

此为datePicker组件问题,暂时关闭该issue。关联#378