React ?'s Flashcards
React uses virtual DOM, what is it?
it updates the dom faster, updates the jsx elements if needed, manipulation is very easy
What is React?
front end javascript library
follows component based approach
What are the features of React?
uses virtual dom, server side rendering
advantages or React?
increases app performance, used on client and server side, JSX makes code easy to read
disadvantages?
just a library, not a framework, library is very large
what is JSX?
JavaScript XML, combination of JS and HTML template syntax
What is the virtual dom?
a copy of the real dom. creates a node tree out of react components. It is re-rendered, and whatever has changes is what gets updated in the dom.
Why can’t browsers read JSX?
Need to transform JSX into a jS object using something like babel, then pass into browser.
ES5 v ES6?
var react = require('react') import React from "react"
What is a component?
Components split up entire react UI into smaller separate pieces. Update without affecting rest of UI.
What is the purpose of Render?
Render is mandatory. Returns a single react component that is a representation of the native dom component.
What are props?
Read only components that are passed down from parent to child. Help maintain uni-directional data flow and used to render dynamic data.
What is state and how is it used?
source of data in react. Keep track of what changes in a component.
difference between state and props?
props get passed to the component (similar to function parameters) whereas state is managed within the component (similar to variables declared within a function).
how to update state?
this.setState or useState hook