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.
20 lines
431 B
JavaScript
20 lines
431 B
JavaScript
import React from 'react';
|
|
import PropTypes from 'prop-types';
|
|
|
|
import './PageHeader.scss';
|
|
|
|
const PageHeader = ({ title, subtitle = '' }) => (
|
|
<div className="PageHeader">
|
|
<div className="PageHeader-container">
|
|
<h1>{title}</h1>
|
|
{subtitle ? <p>{subtitle}</p> : ''}
|
|
</div>
|
|
</div>
|
|
);
|
|
|
|
PageHeader.propTypes = {
|
|
title: PropTypes.string.isRequired,
|
|
subtitle: PropTypes.string,
|
|
};
|
|
|
|
export default PageHeader;
|