Create a component that displays an error message when a specific condition is met.
EasyProblem Statement
Create a component that displays an error message when a specific condition is met.
Sample Input
errorCondition = true
Sample Output
Error: Something went wrong! (when the condition is true)
Limits
Time: 2s · Memory: 256 MB
Code Editor
Log in to submit00:00
Try your code in this preview. Submit marks it done.
import React from "react"; const ErrorMessage = () => { const errorCondition = true; return ( // Conditionally render the error message <></> ); }; export default ErrorMessage;