React Flashcards
What is React?
A JavaScript Library for building user interfaces
what is a React element?
a react element describes what you want to see on the screen
how do you mount a React element to the DOM?
ReactDOM.render(element, container[, callback])
what is babel?
a toolchain that is mainly used to convert ECMAScript 2015+ code into a backwards compatible version of JS in current and older browsers or environments
what is a plug-in?
a software component that adds a specific feature to an existing computer program, enabling customization
what is a webpack loader?
loaders are transformations that are applied to the source code of a module
how can you make babel and webpack work together?
npm install babel loader
what is JSX?
a syntax extension to JavaScript
why must the React object be imported when authoring JSX in a module?
JSX pulls from React
how can you make webpack and babel work together to convert JSX into valid JS?
npm install babel loader babel/plugin-transform-react-jsx react react-dom
what is a React component?
function and/or class that returns React elements
conceptually are like JS functions. they accept arbitrary inputs (called “props”) and return React elements describing what should appear on the screen
how do you define a function component in React?
capital first letter of function name
writes like a JS function
how do you mount a component to the DOM?
ReactDOM.render(element, container)
what are props in React?
Properties, are objects
How do you pass props to a component?
use properties as a parameter and embed as expression