JS and React.js Flashcards
To learn technical jargon (37 cards)
Linting
Software that screens code for syntax errors while differentiating various elements of code
I.D.E.
Integrated Development Environment
D.O.M.
Document Model Object
What must every component do?
*Render some code to the DOM
What 3 arguments are accepted by .createElement?
1) HTML Element
2) Configuration (JS object)
3) Children of Element
Var vs Const
Var: can change
Const: data never changes
Functional Components are written
const cmp = () => { return <div>some JSX</div> }
Class Components are written
class Cmp extends Component { render () { return <div>some JSX</div> } }
Dynamic Code within a JSX Element must be wrapped in?
Single curly braces:
{ dynamic code }
Children
Any Element that is contained between a Components opening and closing tags
Props
Used to dynamically pass code from parent components to child components
Dynamic Code
Not hard coded, code easily able to change
State
Is managed from within a component and if changed will cause a re-render.
Handlers
Class methods that are not actively being called but is triggered by an event
Should State should be mutated?
No
Mutate
To hard change data
How do you inject JS expressions into JSX?
With single curly braces { }
Turnery Operator
? = (if) \: = (else)
.Map( ) does what?
Executes a method on an array
Where is JSX written in React projects
After the Return
Where is JS written in React projects
After the Render
To properly use .Map( ) in needs to be placed on which Element?
The outer most Element
What is a good file structure for a React App?
Src >
Components > (Components)
Assets > (Images)
What is special about PureComponents
They have shouldComponentUpdate checks built in