I like to draw analogies b/w sports and programming. Just like how great sportsmen go through a lack of form (or even a lack of interest, so to speak which is what the case is here), programmers suffer from it too. I have had two such instances in my almost 3-year career so far.
The first time around, it was due to burn out. I had constant 16-17 hour days over a period of six months and it was fun while it lasted. Work was like a drug to me and I was addicted to it. Then, boom all of a sudden, the interest dropped and I absolutely did not want to code. I took a vacation immediately to contemplate what went wrong and I figured, it was a combination of being not able to think clearly, not being to deliver the same results I used to (as a result of burnout) and being bored of the technology I used back then. I immediately switched to few others sides of the product (I was a backend engineer then, I took on the DevOps and front end role for a couple of months and eventually went back to backend and it was fun again). So, a change of technology or teams within the product could bring about the passion back in you. A vacation is absolutely necessary to flush things out and come back with a fresh mind.
The second time around, I was working for a company where we didn't exactly have the greatest culture. I was shipping out features at a rapid pace, but all of a sudden, the only things I could hear from the people above me was rather baseless and aggressive criticism. So, instead of being thrilled about making pull requests, I started getting worried about making one, fearing the arguments that will crop up. So, whenever I went into work, all I could think of was when I could get back home again and had absolutely zero passion to code. In this case, the problem was with a shitty work environment and I was determined to change that. Hence, I quit my job, built some side projects and got the confidence going again to convince myself that I still was the same good developer I used to be.
Long story short, figure out why you feel the way you do. If you don't like the technology, move to something else. If you do not like your job, find a new one (Hashnode is hiring btw :) ). If you are certain that you don't want to code, see if project management would be of interest to you. Take a good long vacation in any case and come back with a happy head and take a decision that you feel is the best for you. Good luck! :)