I am making a project using ReactJS and I am using a statement, but I do not know the name of it.
Here is a bit of my code so it might make sense.
function Login(props) {
return (
<form>
<input
type="text"
placeholder="username"
onChange={e=>props.app.setState({"username":e.currentTarget.value})}
value={props.app.state.username}
/>
<input
type="password"
placeholder="password"
onChange={e=>props.app.setState({"password":e.currentTarget.value})}
value={props.app.state.password}
/>
<button type="button" onClick={_=>props.app.loadTasks()}>Login</button>
{props.app.state.logged_in == -1 && <p className="error">Incorrect username or password</p>}
{props.app.state.logged_in >= -1 && <title>Task Keeper</title>}
</form>
);
}
The exact thing I need a name for is this line here:
{props.app.state.logged_in == -1 && <p className="error">Incorrect username or password</p>}
{props.app.state.logged_in >= -1 && <title>Task Keeper</title>}
Like I am using them and I don't even know what they are called. And if possible explain how is working? I am only assuming is working like an if statement.