Commit Graph

19 Commits

Author SHA1 Message Date
Muhammad Yasir
2a8e0a7ab5 Replaced old ReactDOM API with new React v18 API (#4598)
* Replaced old ReactDOM API with new React v18 API

Replaced old ReactDOM API with new React v18 API

ReactDOM.render(
  // Try changing to isLoggedIn={true}:
  <Greeting isLoggedIn={false} />,
  document.getElementById('root')
);

The above implementation has been replaced by the following implementation according to React v18. 

ReactDOM
  .createRoot(document.getElementById('root'))
  .render(<LoginControl />);

* Changed ReactDOM.createRoot syntax into two lines

```
ReactDOM
  .createRoot(document.getElementById('root'))
  .render(<LoginControl />);
```
has been changed to

```
const root = ReactDOM.createRoot(document.getElementById('root'));
root.render(<LoginControl />);
```

* Added a comment on <Greeting/> comp.
2022-04-27 02:17:23 +01:00
James Herdman
7200653b44 Update conditional-rendering.md to fix formatting (#4493)
A slight inconsistency in the formatting used throughout for `{` `}`.
2022-03-26 17:24:48 +00:00
Jeswin Simon
f92897b27b Updated conditional rendering doc with a note on Falsy values (#3296) 2020-10-01 12:10:16 +02:00
shyamsn00
f3e55c8ce8 Correct grammar in conditional-rendering.md (#3095)
* Correct grammar in conditional-rendering.md

* Correct grammar in content/docs/conditional-rendering.md
2020-07-16 21:39:41 -04:00
Paul Henschel
6f322a438a Update conditional-rendering.md (#1175)
The ternary syntax using parenthesis was an unconventional prettier invention, going out of its way to format react ternaries differently from normal ternaries (if i remember correctly, because vim users had trouble re-formating without a mouse). If they made the right decision or not is one thing, but the additional noise could mislead beginners here, thinking they have to add more characters to make a simple 2-slot ternary, or that it is a "react thing".
2020-03-09 18:30:53 +00:00
Nat Alison
25df15b83e reapply, correctly generating links 2019-02-06 18:03:29 -08:00
Nat Alison
dc1e5366e3 revert id adding 2019-02-06 18:00:52 -08:00
Nat Alison
3e49e971d0 add everything else again 2019-02-06 17:22:04 -08:00
Alex Wilmer
c66250a34a add missing semi-colon in conditional rendering codeblock (#1269) 2018-10-19 01:51:56 -04:00
Michael McGahan
cf628304bb Change name of setState updater first arg to 'state' (#1155) 2018-09-04 23:26:01 +01:00
Alex Krolick
48cbb02dd2 make all redirect_from's arrays (#1075)
make Gatsby happy again
2018-07-19 10:51:07 -07:00
Dan
db66436112 Make CodePen links more prominent and consistent 2018-06-23 02:10:56 +01:00
Adam Saghy
2ea33ffc3d Update conditional-rendering.md (#990)
`componentWillUpdate` method will be called before the render method so the returning value of the render method does not affect.
2018-06-22 23:38:31 +01:00
Dan Abramov
c9e99c8ae6 Avoid unnecessary ternary 2018-06-11 02:05:28 +01:00
Alex Krolick
7ff3c4e9cc let -> const 2018-03-13 23:25:30 -07:00
Alex Krolick
a2e445b85b Prettier 2018-03-13 22:19:00 -07:00
Michael H
d1e8b526ae Adds Ternary Operator to Make Example Concise Issue #657 2018-03-13 22:06:46 -07:00
Zeb DeOs
53a600087b Add semicolon for example code style consistency (#575) 2018-02-03 02:53:53 +00:00
Brian Vaughn
93aa551f1a Reorganized 'docs' folder 2017-10-04 14:48:45 -07:00