React Flashcards
What is React?
JavaScript library. Its aim is to allow developers to easily create fast user interfaces for websites and applications alike.
What is a react element?
It is an object representation of a virtual DOM node.
How do you mount a React element to the DOM?
render()
What is JSX?
a syntax extension to Javascript
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?
What is a React component?
A re-useable UI elements for a React app. It lets you combine your markup, CSS, and JavaScript.
How do you define a function component in React?
function name() {
return (content in here);
}
How do you mount a component to the DOM?
root.render(
<component></component>
);
What are props in React?
How do you pass props to a component?
as an argument
How do you write JavaScript expressions in JSX?
{ content }
What is the purpose of state in React?
It is essentially a components storage.
How do you pass an event handler to a React element?
What is a React Effect?
When should you use an Effect and when should you not use an Effect?
When do effects run?
they run at the end of the render.
What function is used to decalre an Effect?
useEffect (callback function and array dependency
What are Effect dependencies and how do you declare them?
How do you cleanup from an Effect?