Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mateuswetah/wp-components-test
A testing plugin for exploring uses of wp.components without react.
https://github.com/mateuswetah/wp-components-test
Last synced: about 6 hours ago
JSON representation
A testing plugin for exploring uses of wp.components without react.
- Host: GitHub
- URL: https://github.com/mateuswetah/wp-components-test
- Owner: mateuswetah
- Created: 2023-07-21T11:33:28.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-07-21T11:38:28.000Z (over 1 year ago)
- Last Synced: 2023-07-21T12:56:33.858Z (over 1 year ago)
- Language: PHP
- Size: 1000 Bytes
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# WP Components Test
> Is it possible to use the amazing [wp.components](https://developer.wordpress.org/block-editor/reference-guides/components/) in non-react WordPress plugins?
This repository contains a plugin with a couple of tests to explore the possibilities of using the WordPress React components library outside of a React context. Inside [functions.php](/blob/main/functions.php) there is a constant that may be used to switch test:
```php
const TEST_WITH = 'JS' // or 'VUE'
```The existing results are possible due to the [wp.element](https://developer.wordpress.org/block-editor/reference-guides/packages/packages-element/) package, which acts as a wrapper for React [createElement](https://reactjs.org/docs/react-api.html#createelement), a limited but useful alterative to JSX.