UNPKG

strapi-plugin-website-builder

Version:

A plugin for Strapi Headless CMS that provides the ability to trigger website builds manually, periodically or through model events.

27 lines (20 loc) 422 B
/** * * Initializer * */ import { useEffect, useRef } from 'react'; import PropTypes from 'prop-types'; import { PLUGIN_ID } from '../../utils/constants'; const Initializer = ({ setPlugin }) => { const ref = useRef(); ref.current = setPlugin; useEffect(() => { ref.current(PLUGIN_ID); }, []); return null; }; Initializer.propTypes = { setPlugin: PropTypes.func.isRequired, }; export default Initializer;