Examples
This page provides various examples of how to use the react-maintenance package in different scenarios.
Basic Example
This is the simplest way to use the Maintenance component with a boolean flag.
import React from 'react';
import { Maintenance } from 'react-maintenance';
function App() {
return (
<Maintenance
title="Under Maintenance"
message="We are currently performing scheduled maintenance. Please check back later."
>
<div className="app">
<h1>Welcome to My App</h1>
<p>This content is only visible when not in maintenance mode.</p>
</div>
</Maintenance>
);
}
Under Maintenance
We are currently performing scheduled maintenance. Please check back later.