Like many ppl have said already, learning an instrument and music theory will definitely help you when it comes to chords, melodies, arrangements, etc. It also depends on the type of music you produce. For the longest time of me producing music, I've only stuck to boom bap sampled beats. I didn't really need to learn an instrument as I was just using samples. Although I didn't know much theory, I relied on my ears to tell me what sounded good and what didn't. At the end of the day, that's all that matters, and you could be a theory expert, but if you can't trust your ears, I feel like you would get stuck in some kind of box. I mean a lot of genres like jazz or neo soul for exemple stepped outside the box of "classical" music theory, but it sounded good so they became very popular.
If your producing original music, learning the piano and basic theory is a good tool which will help you lay down more easily the ideas that you have in your head. It will also give you a good foundation on which you can build your own thing. When I make a beat, I just play a bunch of chords until I find a progression that I like without worrying much about key or scale. than when it comes to melodies, I do the same process, but try to somewhat stick to the notes that the underlying chord is playing (not always tho). Again, at the end of the day, your ears are the final judges so don't be afraid to try different things.
Just to add a lil something more on the topic. When I make a beat, I usually come at it from the perspective of a composer and not necessarily and instrument player. It's all about arrangements and what sounds good with what imo.