Below code is working fine with button that is created in this code .but i also want to use the enter button to do same work .
<div className="input" > <input type="text" placeholder="Type something..." id="myinput" onChange={(e) => setText(e.target.value)} value={text} /> <div className="send"> {/* <img src={Attach} alt="attach" /> */} <input type="file" style={{ display: "none" }} id="file" onChange={(e) => setImg(e.target.files[0])} /> <label htmlFor="file"> <img src={Attach} alt="img" /> </label> <button onClick={handleSend}>Send</button> </div> </div> how to achieve that?
document(in auseEffect, and remove it in the cleanup).