Create New Item
Item Type
File
Folder
Item Name
Search file in folder and subfolders...
Are you sure want to rename?
optometrists
/
cache
/
cache
/
cache
/
cache
/
cache
/
cache
/
.wp-cli
/
wp-content
/
plugins
/
woocommerce
/
packages
/
woocommerce-blocks
/
assets
/
js
/
base
/
hocs
:
with-filtered-attributes.js
Advanced Search
Upload
New Item
Settings
Back
Back Up
Advanced Editor
Save
/** * External dependencies */ import { getValidBlockAttributes } from '@woocommerce/base-utils'; /** * HOC that filters given attributes by valid block attribute values, or uses defaults if undefined. * * @param {Object} blockAttributes Component being wrapped. */ const withFilteredAttributes = ( blockAttributes ) => ( OriginalComponent ) => { return ( ownProps ) => { const validBlockAttributes = getValidBlockAttributes( blockAttributes, ownProps ); return ( <OriginalComponent { ...ownProps } { ...validBlockAttributes } /> ); }; }; export default withFilteredAttributes;