简体   繁体   English

收到非布尔属性“可关闭”的“假”

[英]Received `false` for a non-boolean attribute `closable`

I have this code我有这个代码

import { Modal } from "antd";
import styled from "styled-components";

export const StANTModal = styled(Modal)`
  & .ant-modal-content {
    border-radius: 20px;
    overflow: hidden;
  }
`;

and using like this并像这样使用

 <StANTModal
      visible={showModal}
      footer={false}
      closable={false}
      onCancel={() => setShowModal(false)}
      transitionName="ant-move-down"
      maskTransitionName="ant-move-down"
      width={600}
    >
    // not related code
  </StANTModal>

and I have this log我有这个日志

warning :react-dom.development.js:67 Warning: Received `false` for a non-boolean attribute `visible`.

If you want to write it to the DOM, pass a string instead: visible="false" or visible={value.toString()}.

If you used to conditionally omit it with visible={condition && value}, pass visible={condition ? value : undefined} instead.

It works perfectly but I don't want to see this log in my console.它工作得很好,但我不想在我的控制台中看到这个日志。

I am using react with Typescript and ant design.我正在使用对 Typescript 和 ant design 的反应。

这个问题来自 antd 库

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 收到非布尔属性“loading”的“false” - Received `false` for a non-boolean attribute `loading` 警告:收到非布尔属性的“false” - Warning: Received `false` for a non-boolean attribute 警告:收到非布尔属性“border”的“false”。 在反应? - Warning: Received `false` for a non-boolean attribute `border`. in react? 收到非布尔属性 Reactjs 的“真” - Received `true` for a non-boolean attribute Reactjs React 收到非布尔属性的 `true` - React received `true` for a non-boolean attribute 收到非布尔属性“exact”的“true” - Received `true` for a non-boolean attribute `exact` 警告:收到非布尔属性的“假”。 如何传递 boolean 值? - Warning: Received `false` for a non-boolean attribute. How do I pass a boolean value? 警告:收到非布尔属性“className”的“false”。 如果要将其写入 DOM,请改为传递一个字符串:className=&quot;false&quot; 或 - Warning: Received `false` for a non-boolean attribute `className`. If you want to write it to the DOM, pass a string instead: className=“false” or React 表单警告:收到非布尔属性“validate”的“true” - Warning with React form: Received `true` for a non-boolean attribute `validate` 对 NAVLINK 的反应路由接收到 TRUE 的非布尔属性 - React Route for NAVLINK Received TRUE for a non-boolean attribute
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM