API Reference
This page provides detailed information about all the props and options available for the Maintenance component.
Component Props
The Maintenance component accepts the following props:
interface MaintenanceProps {
// Optional props with defaults
title?: string; // Default: "Under Maintenance"
message?: string; // Default: "We are currently performing scheduled maintenance. Please check back later."
CustomComponent?: React.ReactNode; // Default: null
startTime?: Date | string; // Default: undefined
endTime?: Date | string; // Default: undefined
showCountdown?: boolean; // Default: false
customStyles?: { // Default: {}
page?: React.CSSProperties;
container?: React.CSSProperties;
title?: React.CSSProperties;
message?: React.CSSProperties;
countdown?: React.CSSProperties;
};
// Children are rendered when maintenance mode is disabled
children?: React.ReactNode; // Default: null
}
Required Environment
REACT_APP_PRODUCTION
Type: boolean
The environment variable that indicates whether the application is running in production mode. When REACT_APP_PRODUCTION
is set, the maintenance screen is displayed.
If REACT_APP_PRODUCTION
is not set, the application will run in development mode, and the maintenance screen will not be shown.
Ensure to set REACT_APP_PRODUCTION
in your environment variables for the maintenance mode to function correctly.
Additionally, make sure to test your application in production mode to verify the maintenance screen behaves as expected.
REACT_APP_PRODUCTION=true