Components that track offline and online state. Render certain content only when online (or only when offline).
import Offline Online from 'react-detect-offline';const App =<div><Online>Only shown when online</Online><Offline>Only shown </Offline></div>;
<Online> - Component that renders its children only when the browser is online.
<Offline> - Component that renders its children only when the browser is not online.
Offline are mutually exclusive; if one is rendering, the other will not be.
Offlineto remind users they might need to connect to complete certain actions.
Onlineto let readers know the page is available offline.
Onlineto hide links or other content that is irrelevant when offline.