Ok, my title is a little bit of clickbait. Let me tell you a secret, I don’t believe there is a “right” way. Does your block work? Does it solve a problem for someone? Than you made it the “right” way and don’t let anyone tell you otherwise.
I’m a firm believer in shipping & iterating. Think of all the time you spend discussing the best way to do something. What if that time was spent actually writing code? You could have been already done with the block in the time you spend discussing the right way to do it.
That’s why I don’t have comments on this site nor log onto Twitter anymore. I have no desire to debate people. I know exactly what I want to make and if I create something no one wants, so be it. I would much rather create a block that no one users that not make one at all.
When I talk about the right way I’m not talking about coding standards or anything like that. I’m talking about philosophy and minutia. Sometimes people will suggest something that people will argue isn’t needed or people won’t use. The WordPress ecosystem is vast, no one can know everything that people will or won’t need.
My rule of thumb is does this solve a problem that you are having? If so, launch it as I’m sure there has to be others having the same issue . If you only create things with a known user base, there will never be any innovation. Let the market decide if there is a place for your block.
You also need to avoid this trap of getting caught in the small details. Just launch your block and your users will let you know exactly what you did wrong. Most of the time the small things you agonized about will be the things that no one cares about.
What are you waiting for? The blog post is over. Go build something.