React JS Flashcards
What is React?
A JavaScript library for building user interfaces
What is a React element?
an object
How do you mount a React element to the DOM?
create React element,
query the dom for html element
pass the dom element to ReactDOM root object
root.render(element
What is JSX?
Javascript syntax extension used to create React element
Why must the React object be imported when authoring JSX in a module?
How can you make Webpack and Babel work together to convert JSX into valid JavaScript?
use Babel loader to hook it up to Webpack and
What is a React component?
Javascript expression
How do you define a function component in React?
How do you mount a component to the DOM?
How do you create “class” component in React?
How do you access props in a class component?
What are props in React?
How do you pass props to a component?
How do you write JavaScript expressions in JSX?
What is the purpose of state in React?
To keep track of things that change over time
How to you pass an event handler to a React element?
pass an event handler as a prop to an element
whatever you’re listening for
javascript expression