Fix: Remove unneeded else branches from documentation examples

This commit is contained in:
Andreas Möller 2016-10-24 09:07:10 +02:00 committed by Dan Abramov
parent a4b9abff42
commit 1e126c29dd
3 changed files with 3 additions and 6 deletions

View File

@ -30,9 +30,8 @@ function Greeting(props) {
const isLoggedIn = props.isLoggedIn;
if (isLoggedIn) {
return <UserGreeting />;
} else {
return <GuestGreeting />;
}
return <GuestGreeting />;
}
ReactDOM.render(

View File

@ -60,9 +60,8 @@ This means that you can use JSX inside of `if` statements and `for` loops, assig
function getGreeting(user) {
if (user) {
return <h1>Hello, {formatName(user)}!</h1>;
} else {
return <h1>Hello, Stranger.</h1>;
}
return <h1>Hello, Stranger.</h1>;
}
```

View File

@ -16,9 +16,8 @@ We will start with a component called `BoilingVerdict`. It accepts the `celsius`
function BoilingVerdict(props) {
if (props.celsius >= 100) {
return <p>The water would boil.</p>;
} else {
return <p>The water would not boil.</p>;
}
return <p>The water would not boil.</p>;
}
```