I followed a fairly simple tutorial [here]) demonstrating how to make a custom block by creating a plug-in to be installed in a theme. It had me make a **javascript** file and a **php** file, and the javascript used React to create the HTML elements for the theme. The Javascript was not JSX. I got it working just fine, and created a simple block with two text inputs, and everything was super simple and straightforward.
However, I then wanted to add the ability for the block to support uploading of images, and for the life of me, I cannot find a single tutorial or webpage that explains how to do this without me having to completely start from scratch, get an NPM (I don’t even know what that is), use JSX, and just… create an entirely new environment and go through several more hours of tutorials just to add this functionality to my block.
Am I missing something? Why is there such a gap between a simple text block and a block with the ability to use images? Or am I just using bad tutorials? Almost all the tutorials I use use an NPM and JSX and redirect to even longer tutorials on how to set that up. I don’t want to spend 16 hours setting up an environment to add one function to one block if I don’t need to.
[ad_2]