Basic over view Flashcards
What are Components ?
Basically JavaScript classes with a state and a render
What does a class look like
Class Name { state: {}; render () {} }
What is the render( ) { }
Method to a react element
What is a react element
a plan Java script obj that maps to DOM element
How many DOM are there
Virtual DOM and real Dom, children must be kept in order
Where is the root container held
In the index.html file
What extends app.js ?
extends by Component at built in Java Script class
How to write app class
Class App extends Component {render() { returns JSX;
}}
What is babel
A modern java script compiler
how to make a bisc react element
const element = <> </>;
Import React from ‘react’; which is the module and obj
React obj ‘react’ is module
2 obj that must be imported
React
ReactDOM
What is hot module reloading, t
This is where react uses babbel to to compile JavaScript objects directly on the fly
What are the two arguments in react Dom
Element, document get Element by ID
Shortcut for import react component
I MRC
Shortcut for class components
CC
How to rap to html elements togeather
React.Fragment
State is an object and what does it hold ?
properties
What is an expression
Javascript the expression references the state or function object using this keyword
Example of object destructuring
const { count } = this.state;
How to write if for state count
return count === 0 ? “Zero” : count;
How to render a list of tags [ ]
this.state.tags.map(
(tag) => (<li key={tag}>{tag}</li>
What is setting attributes
className = / styles
If && operator is applied second True is printed out
True && “ hi”