Converting React to wordpress

[ad_1]

Hi folks,

I’ve been working on a react website and it has become apparent that it’s becoming quite text heavy and so I’d like to switch to a content management system like wordpress.

I’ve written a custom react component that i’d like to embed into a couple of the wordpress pages, and I’m finding this difficult to complete..

I’ve been following the following instructions to make my component:
[https://developer.wordpress.org/block-editor/getting-started/create-block/wp-plugin/])

These instructions funnel the reader down into creating a “block”. The index.js file contains a registration step for the block which is an important step:

\`\`\`

/\*\*
 \* Every block starts by registering a new block type definition.
 \*
 \* u/see
 \*/
registerBlockType( metadata.name, {
/\*\*
     \* @see ./edit.js
     \*/
edit: Edit,
/\*\*
     \* @see ./save.js
     \*/
save: save,
} );

\`\`\`

Where Edit and save functions are defined elsewhere (by me). The Edit function is my react component and when I upload the plugin to wordpress, it renders in the wordpress editor just fine. But when the wordpress page is displayed, there is nothing rendered to screen.

Am I barking up the wrong tree by creating a “block” ? If so, can you point me in the right direction please?

​

kind regards!

[ad_2]

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer