0
                  <input
                    onChange={(e) => {
                    console.log(e.target.files[0])
                    }}
                    ref={fileRef}
                    type="file"
                    className="fileType"
                    accept={
                      filetype === 'image'
                        ? 'image/*'
                        : data.Contest.type === 'audio'
                        ? 'audio/*'
                        : data.Contest.type === 'video'
                        ? 'video/*'
                        : 'audio/*,video/*,image/*'
                    }
                  />
               <p
                onClick={() => {
                  if (null !== fileRef.current) {
                    fileRef.current.click();
                  }
                }}
                className="file_text"
                style={fileName ? { color: '#3bb5a2' } : { 
                color: '#9d9d9d' }}
                >
                {fileName ? fileName : 'Choose file...'}
              </p>

dialogue box open with the help of ref. ionic-react with capacitor. after file choose the page is refreshing. how can i stop this behaviour.

Sumit Sharma
  • 160
  • 9

0 Answers0