Turning wordpress/components into blocks
-
I have been combing through the documentation and looking for tutorials. I’m sure I must be missing something, but this seems like a simple thing.
I can see that there exists “@wordpress/components” and I can successfully add, for example, a <Card> component – complete with <CardHeader> and <CardBody> into my edit.js and see it rendered beautifully in the block editor. However, when I add the <Card>,<CardHeader, and <CardBody> to the save.js I do not see anything rendered at all. Not even the text inside. It will render when I create a <div class=”myCard,myCardHeader,etc.”> but that hardly makes this a time saver. Is there a step I am missing? I can’t see any meaningful error logs or anything like that.
Is there a tutorial that simply walks through taking one of these components and turning it into a custom block?
I started with the gutenberg pride block. That works great and I’ve been able to make a few useful blocks with just that knowledge, but it would be nice to be able to use these pre-built components to add functionality for our users.
Thanks!
- The topic ‘Turning wordpress/components into blocks’ is closed to new replies.