# extendify/0.6.0/src/middleware/hasRequiredPlugins/index.js

Extendify, version 0.6.0. 20 lines.

- Page: https://pluginprobe.com/plugins/extendify/0.6.0/code/src/middleware/hasRequiredPlugins/index.js
- Raw: https://pluginprobe.com/plugins/extendify/0.6.0/raw/src/middleware/hasRequiredPlugins/index.js
- Modified: 2022-02-23T01:03:38+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/extendify/0.6.0/code/src/middleware/hasRequiredPlugins/index.js#L10-L20`.

```javascript
import { render } from '@wordpress/element'
import { checkIfUserNeedsToInstallPlugins } from '../helpers'
import RequiredPluginsModal from './RequiredPluginsModal'

export const hasRequiredPlugins = async (template) => {
    return {
        id: 'hasRequiredPlugins',
        pass: !(await checkIfUserNeedsToInstallPlugins(template)),
        allow() {},
        deny() {
            return new Promise(() => {
                render(
                    <RequiredPluginsModal />,
                    document.getElementById('extendify-root'),
                )
            })
        },
    }
}

```
