Block Making

concepts for making blocks in this project

Demonstration

Block Making Demonstration

File Structure

This is the file structure from create-react-block. You can copy an existing block for convenience.

Register Block in index.tsx

circle-info

Any block attributes that you rely on to hydrate your components should be registered in index.tsx with their type and ideally a default value.

Create Custom Post Type - if needed

Build Your Query - if using a postType for your block

You can use the GraphQl IDE in the Wordpress Backend to build your query.

GraphQl IDE

Make Your Frontend Block

When creating & registering your block the naming convention is to kabab-case rather than TitleCase or camelCase.

Detail Page with Dynamic Routes

Query Details for Single Item

Last updated