Use defaultProps to set up the taxonomy control operators (https://github.com/woocommerce/woocommerce-blocks/pull/381)
This commit is contained in:
parent
ac96484f7a
commit
5f4b6c74db
|
@ -90,7 +90,7 @@ class ProductAttributeControl extends Component {
|
|||
|
||||
render() {
|
||||
const { list, loading } = this.state;
|
||||
const { onChange, onOperatorChange, operator = 'any', selected } = this.props;
|
||||
const { onChange, onOperatorChange, operator, selected } = this.props;
|
||||
|
||||
const messages = {
|
||||
clear: __( 'Clear all product attributes', 'woo-gutenberg-products-block' ),
|
||||
|
@ -176,4 +176,8 @@ ProductAttributeControl.propTypes = {
|
|||
selected: PropTypes.array.isRequired,
|
||||
};
|
||||
|
||||
ProductAttributeControl.defaultProps = {
|
||||
operator: 'any',
|
||||
};
|
||||
|
||||
export default ProductAttributeControl;
|
||||
|
|
|
@ -75,7 +75,7 @@ class ProductCategoryControl extends Component {
|
|||
|
||||
render() {
|
||||
const { list, loading } = this.state;
|
||||
const { onChange, onOperatorChange, operator = 'any', selected } = this.props;
|
||||
const { onChange, onOperatorChange, operator, selected } = this.props;
|
||||
|
||||
const messages = {
|
||||
clear: __( 'Clear all product categories', 'woo-gutenberg-products-block' ),
|
||||
|
@ -161,4 +161,8 @@ ProductCategoryControl.propTypes = {
|
|||
selected: PropTypes.array.isRequired,
|
||||
};
|
||||
|
||||
ProductCategoryControl.defaultProps = {
|
||||
operator: 'any',
|
||||
};
|
||||
|
||||
export default ProductCategoryControl;
|
||||
|
|
Loading…
Reference in New Issue