way to describe your ui. • Looks like a template language. • Babel is used to compile JSX down to React.createElement() calls. • After compilation, JSX expressions become regular JavaScript objects. • This means that you can use JSX inside of if statements and for loops, assign it to variables, accept it as arguments, and return it from functions
• You write modern javascript and its compiled down to a version compatible with most browsers. • In this presentation we will be seeing some ECMAScript 2015 which is an ECMAScript standard that was considered official in June 2015. • Its browser support is well under development. • Don’t worry we will quickly go over the features you need to know.
(var multiply = function (a) { return a *a; }) ◦ (a, b) => { const sum = a + b; return sum; } • Template literals ◦ `string text ${expression} string text` (these ` are back ticks) • Block-scoped binding constructs, let is the new var and const is used to define constants. • Classes • Modules • Learn more on: http://babeljs.io/learn-es2015/
jump start into react development by configuring everything for us: 1. npm install -g create-react-app 2. create-react-app my-app 3. cd my-app 4. npm start
Return a react elements • Can be used on other components • Extracting logic into smaller components is encouraged • PropTypes can be defined for type checking which data is accepted. • PropTypes are read only
private and only controller by the component. • Components can only manage and know their own state. • Used to define implementation details of that component. • State should not be altered directly. Use this.setState setter.
state or the parent props changes it will cause the component to re-render. • When this changes occur react uses dom diffing to decide which part of the dom is to be modified. • You can control some aspects of this during the component life cycle.