Programming Exercises

Write a React component that conditionally displays 'Logged In' or 'Logged Out' based on a hardcoded boolean state.

Easy

Problem Statement

Write a React component that conditionally displays 'Logged In' or 'Logged Out' based on a hardcoded boolean state.

Sample Input

isLoggedIn = true

Sample Output

Logged In (if true) or Logged Out (if false).

Limits

Time: 2s · Memory: 256 MB

Code Editor
00:00
import React from "react"; const LoginStatus = () => { const isLoggedIn = true; // Hardcoded state return ( // Conditionally display "Logged In" or "Logged Out" <></> ); }; export default LoginStatus;
Log in or sign up to run or submit your code.Log inSign up
Input
isLoggedIn = true
Expected Output
Logged In (if true) or Logged Out (if false).