ReactQuill got crashed when it prints depend on a dropdown value

Viewed 12

I want to use reactQuill in my react page. But there is some steps to show that rectquill field. If I select type = admin or type = pm then only need to show the quill other values inside the type dropdown selection no need to show.. On first time I select admin then I changed to 'pm' type, an error occurs like my page is crashed. If I select any other type rather than admin and pm, no issues. My code is like,

     <Form.Item name="Type" label="Type" required rules={[{ required: true, message: "Please select" }]}>
    <Select size="small"
     placeholder="Select..."
     showSearch
     filterOption={(input, option) =>
                                    
  option.children.toLowerCase().indexOf(input.toLowerCase()) >= 0
       }>
 {data && data.types && data.types.map((dd) => <Select.Option value={dd.name}>{dd.name}</Select.Option>)}
     </Select>
   </Form.Item>
    
     {(this.form && (this.form.getFieldValue('Type') === "admin" || this.form.getFieldValue('Type') === "pm")) && <Col md={24} xs={12}>
    <Form.Item name='openingmessage' label="Opening Message" required rules={[{ required: true, message: "Please enter opening message" }]}>
      <ReactQuill modules={modules} formats={formats}/>
       </Form.Item>
         </Col>
           }

How to resolve my problem

0 Answers
Related