Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jetpack settings page: Removing defaultProps from SearchableModules component #38546

Merged
merged 3 commits into from
Jul 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { withModuleSettingsFormHelpers } from 'components/module-settings/with-m
import SettingsCard from 'components/settings-card';
import SettingsGroup from 'components/settings-group';
import { includes, forEach } from 'lodash';
import PropTypes from 'prop-types';
import React, { Component } from 'react';
import { connect } from 'react-redux';
import {
Expand All @@ -30,7 +29,7 @@ export const SearchableModules = withModuleSettingsFormHelpers(
}

// Only render if search terms present
const searchTerms = this.props.searchTerm;
const searchTerms = this.props.searchTerm || '';
if ( searchTerms.length < 3 ) {
return null;
}
Expand Down Expand Up @@ -84,14 +83,6 @@ export const SearchableModules = withModuleSettingsFormHelpers(
}
);

SearchableModules.propTypes = {
searchTerm: PropTypes.string,
};

SearchableModules.defaultProps = {
searchTerm: '',
};

class ActiveCard extends Component {
render() {
const m = this.props.moduleData,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: other

Admin page: Remove propTypes and defaultProps from code due to React legacy code warnings.
Loading