Fix: Remove unneeded else branches from documentation examples
Andreas Möller committed
Oct 24, 2016 at 09:07 UTC
1e126c29dd03073c82883ee666fd0a2c3172cdbd
3 files changed
+3
-6
docs/docs/conditional-rendering.md
+1
-2
@@ -30,9 +30,8 @@ function Greeting(props) {
30
const isLoggedIn = props.isLoggedIn;
31
if (isLoggedIn) {
32
return <UserGreeting />;
33
- } else {
34
- return <GuestGreeting />;
33
}
34
+ return <GuestGreeting />;
35
}
36
37
ReactDOM.render(
docs/docs/introducing-jsx.md
+1
-2
@@ -60,9 +60,8 @@ This means that you can use JSX inside of `if` statements and `for` loops, assig
60
function getGreeting(user) {
61
if (user) {
62
return <h1>Hello, {formatName(user)}!</h1>;
63
- } else {
64
- return <h1>Hello, Stranger.</h1>;
63
}
64
+ return <h1>Hello, Stranger.</h1>;
65
}
66
```
67
docs/docs/lifting-state-up.md
+1
-2
@@ -16,9 +16,8 @@ We will start with a component called `BoilingVerdict`. It accepts the `celsius`
16
function BoilingVerdict(props) {
17
if (props.celsius >= 100) {
18
return <p>The water would boil.</p>;
19
- } else {
20
- return <p>The water would not boil.</p>;
19
}
20
+ return <p>The water would not boil.</p>;
21
}
22
```
23