Skip to content

Commit

Permalink
chore: remove obsolete defaultProps (ENG-58170)
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenle17 committed Oct 11, 2024
1 parent 9b6f4c4 commit 0b38d15
Show file tree
Hide file tree
Showing 7 changed files with 4 additions and 30 deletions.
2 changes: 0 additions & 2 deletions __tests__/components/__snapshots__/DropdownMenu.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ exports[`DropdownMenu Rendering Render the DropdownMenu component default props
icon={[Function]}
onClick={[MockFunction]}
onKeyDown={[MockFunction]}
size="medium"
type="ghost"
/>
<React.Portal
container="body"
Expand Down
5 changes: 0 additions & 5 deletions src/components/DropdownMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -174,9 +174,4 @@ DropdownMenu.propTypes = {
),
};

DropdownMenu.defaultProps = {
size: 'medium',
type: 'ghost',
};

export default DropdownMenu;
12 changes: 3 additions & 9 deletions src/components/FormButtons.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ import './FormButtons.less';
*/

const FormButtons = ({
cancelButtonLabel,
saveButtonLabel,
childrenPosition,
cancelButtonLabel = t`Cancel`,
saveButtonLabel = t`Save`,
childrenPosition = 'end',
children,
className,
}) => {
Expand Down Expand Up @@ -72,10 +72,4 @@ FormButtons.propTypes = {
className: PropTypes.string,
};

FormButtons.defaultProps = {
cancelButtonLabel: t`Cancel`,
saveButtonLabel: t`Save`,
childrenPosition: 'end',
};

export default FormButtons;
7 changes: 1 addition & 6 deletions src/components/PageMessages.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import PropTypes from 'prop-types';
import { Toast } from '@bluecateng/pelagos';
import PageMessagesContext from './PageMessagesContext';

const PageMessages = ({ initialMessages, children }) => {
const PageMessages = ({ initialMessages = [], children }) => {
const [messages, setMessages] = useState(initialMessages);

const addMessages = (messages) => {
Expand Down Expand Up @@ -73,9 +73,4 @@ PageMessages.propTypes = {
children: PropTypes.oneOfType([PropTypes.node, PropTypes.array]),
};

PageMessages.defaultProps = {
/** The initial messages. */
initialMessages: [],
};

export default PageMessages;
2 changes: 0 additions & 2 deletions src/components/PageModalSpinner.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,4 @@ PageModalSpinner.propTypes = {
children: PropTypes.oneOfType([PropTypes.node, PropTypes.array]),
};

PageModalSpinner.defaultProps = {};

export default PageModalSpinner;
2 changes: 0 additions & 2 deletions src/components/PlatformData.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,4 @@ PlatformData.propTypes = {
children: PropTypes.oneOfType([PropTypes.node, PropTypes.array]),
};

PlatformData.defaultProps = {};

export default PlatformData;
4 changes: 0 additions & 4 deletions src/components/SidePanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,4 @@ SidePanel.propTypes = {
]),
};

SidePanel.defaultProps = {
size: 'small',
};

export default SidePanel;

0 comments on commit 0b38d15

Please sign in to comment.