Utils package

As we are using a multi-package-/mono repository we have the ability and advantage of modular package development. That means, coding which should be used in multiple plugins can be outsourced to an own package. This can also be done for PHP (packages/utils/src), but this does not matter here.

Create packagechevron-right

With create-wp-react-app create-workspace a main utils package in packages/utils is generated automatically.

Factories

All of your plugins can use the factories defined in packages/utils/lib/factory. They do a lot of work for you and implement a high standard for the following topics:

circle-info

You do not need to call that factories manually because they are consumed automatically in your generated plugin file plugins/your-plugin/src/public/ts/utils/index.tsx. Just use them.

It is recommend to not extend that utils package by yourself. Imagine you want to upgrade to a newer version of WP ReactJS Starter you need to copy & paste all your customizations manually. Create another package!

Last updated