screen_rotation
Copied to Clipboard
<!DOCTYPE html> <html> <head> <meta charset="UTF-8" /> <script src="https://unpkg.com/react@17.0.2/umd/react.development.js"></script> <script src="https://unpkg.com/react-dom@17.0.2/umd/react-dom.development.js"></script> <script src="https://cdn.jsdelivr.net/npm/@babel/standalone@7.14.6/babel.min.js"></script> </head> <body> <div id="app"></div> <script type="text/babel" data-presets="env,react"> const { useEffect } = React; function App() { useEffect(() => { const interval = setInterval(() => { // Reload the page window.parent.location.reload(); }, 60000); // 60000 milliseconds = 1 minute // Clear the interval when the component unmounts return () => clearInterval(interval); }, []); return ( <div className="container"> <h1>React Refresh Page Every Minute</h1> <p>This is your component content.</p> </div> ); } ReactDOM.render(<App />, document.getElementById("app")); </script> <style> .container { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100vh; position: relative; } h1 { text-align: center; } </style> </body> </html>