Untitled
unknown
plain_text
a year ago
673 B
4
Indexable
import React, { useState } from 'react'; import Login from './Login'; // Import the Login component import Signup from './Signup'; // Import the Signup component const LoginSignupPage = () => { const [showLogin, setShowLogin] = useState(true); // State to toggle between login and signup forms return ( <div> {showLogin ? <Login /> : <Signup />} {/* Render the Login or Signup component based on showLogin state */} <button onClick={() => setShowLogin(!showLogin)}> {showLogin ? 'Switch to Signup' : 'Switch to Login'} {/* Button to toggle between login and signup forms */} </button> </div> ); }; export default LoginSignupPage;
Editor is loading...
Leave a Comment