UNPKG

@wordpress/upload-media

Version:
30 lines (29 loc) 797 B
/** * WordPress dependencies */ import { useEffect } from '@wordpress/element'; import { useDispatch } from '@wordpress/data'; /** * Internal dependencies */ import withRegistryProvider from './with-registry-provider'; import { unlock } from '../../lock-unlock'; import { store as uploadStore } from '../../store'; import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime"; const MediaUploadProvider = withRegistryProvider(props => { const { children, settings } = props; const { updateSettings } = unlock(useDispatch(uploadStore)); useEffect(() => { updateSettings(settings); }, [settings, updateSettings]); return /*#__PURE__*/_jsx(_Fragment, { children: children }); }); export default MediaUploadProvider; //# sourceMappingURL=index.js.map