mukeshphulwani66 / Instagram-clone-MERN-Stack

296 stars 212 forks source link

After commenting on a post the comment line does not erase itself #15

Open ankan1811 opened 3 years ago

ankan1811 commented 3 years ago

issue1

Check this issue. The comment line must be empty after commenting.

moamlrh commented 3 years ago

const onSubmit = () => { setCommentValue('') }

Hartaj-Singh-Dev commented 3 years ago

yes You have to create state and then fill the input of comment box as <input value={comment} onChange={(event)=>{setcomment(event.target.value)}/> and then you have to create a submit button like this <button onClick={()=>{Submit()}}>Post and now you can define the 'Submit()' function as const Submit = ()=>{ setcomment('') }

savarsri commented 6 months ago

Fixed in pull request 46