About the forced rendering of the Model component nesting other components Modal

Hits: 0

Sometimes we need to use the [Model] component to display data with initial values, such as Form, video waiting, but when assigning an external function or executing its own function, it will prompt null, and we need to add a forceRender={true} attribute to the Model, generally The child component uses ref, and the Model needs to add such an attribute

<Modal
        width={650}
        forceRender={true}
        visible={visible}
        maskClosable={false}
        //onOk={handleOk}
        // confirmLoading={confirmLoading}
        onCancel={handleCancel}
        footer={null}
      >
        <video
          ref={videoRef}
          src={audioPlayUrl}
          width="600"
          height="350"
          controls
          autoPlay
          played={play}
        />
      </Modal>

You may also like...

Leave a Reply

Your email address will not be published.