Aloysious' Codefellows Reading Notes
<== Home 🏠
The smallest React example looks like this:
ReactDOM.render(
<h1>Hello, world!</h1>,
document.getElementById('root')
);
It displays a heading saying “Hello, world!” on the page.
Things to consider when reading React documentation:
let
and const
statements. For the purposes of the React documentation, you can consider them equivalent to var
.class
keyword to define JavaScript classes. There are two things worth remembering about them. Firstly, unlike with objects, you don’t need to put commas between class method definitions. Secondly, unlike many other languages with classes, in JavaScript the value of this
in a method depends on how it is called.=>
to define "arrow functions". They’re like regular functions, but shorter. For example, x => x * 2
is roughly equivalent to function(x) { return x * 2; }
. Importantly, arrow functions don't have their own this
value so they’re handy when you want to preserve the this
value from an outer method definition.to be continued…
to be continued…
to be continued…
<== Home 🏠