Browse Source

Fix: Remove unneeded else branches from documentation examples

main
Andreas Möller 9 years ago
committed by Dan Abramov
parent
commit
823154cbfc
  1. 3
      docs/conditional-rendering.md
  2. 3
      docs/introducing-jsx.md
  3. 3
      docs/lifting-state-up.md

3
docs/conditional-rendering.md

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

3
docs/introducing-jsx.md

@ -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>;
}
```

3
docs/lifting-state-up.md

@ -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…
Cancel
Save