Fix: Remove unneeded else branches from documentation examples
This commit is contained in:
parent
a4b9abff42
commit
1e126c29dd
|
@ -30,9 +30,8 @@ function Greeting(props) {
|
|||
const isLoggedIn = props.isLoggedIn;
|
||||
if (isLoggedIn) {
|
||||
return <UserGreeting />;
|
||||
} else {
|
||||
return <GuestGreeting />;
|
||||
}
|
||||
return <GuestGreeting />;
|
||||
}
|
||||
|
||||
ReactDOM.render(
|
||||
|
|
|
@ -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>;
|
||||
}
|
||||
```
|
||||
|
||||
|
|
|
@ -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>;
|
||||
}
|
||||
```
|
||||
|
||||
|
|
Loading…
Reference in New Issue