cleanup: defaultProps -> JS default params on our function components
React 19 drops defaultProps on function components. Converted the 9 of
ours that used it (App, Navigation, ReSendEmail, Reconnect, OAuthLoginButton,
PageHeader, Page, EditDocument, EditSubscription) to destructured default
params; App defaults userId/emailAddress in its withTracker instead (it
spreads {...props} widely). Class components keep defaultProps (still
supported). The only defaultProps warnings left are from the react-share
npm package (CreatedButton/Icon), not our code. REST smoke byte-identical.
This commit is contained in:
parent
5661e129fb
commit
4ddaa0d8ec
9 changed files with 17 additions and 51 deletions
|
|
@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
|
|||
|
||||
import './PageHeader.scss';
|
||||
|
||||
const PageHeader = ({ title, subtitle }) => (
|
||||
const PageHeader = ({ title, subtitle = '' }) => (
|
||||
<div className="PageHeader">
|
||||
<div className="PageHeader-container">
|
||||
<h1>{title}</h1>
|
||||
|
|
@ -12,10 +12,6 @@ const PageHeader = ({ title, subtitle }) => (
|
|||
</div>
|
||||
);
|
||||
|
||||
PageHeader.defaultProps = {
|
||||
subtitle: '',
|
||||
};
|
||||
|
||||
PageHeader.propTypes = {
|
||||
title: PropTypes.string.isRequired,
|
||||
subtitle: PropTypes.string,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue