Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
cuilanxin opened this issue Oct 25, 2021 · 3 comments

Comments

@cuilanxin
Copy link
Contributor

cuilanxin commented Oct 25, 2021

控制台输入如下

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
Copy link
Contributor Author

2021-10-30.10.49.25.mov

@cuilanxin
Copy link
Contributor Author

功能也会失效

@ChenlingasMx
Copy link
Collaborator

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants