react Flashcards
what is react
react is a javascript framework for interactive UI
What is a React element?
an element made in react that returns an html element
How do you mount a React element to the DOM?
ReactDOM.createRoot( queried element )
What is JSX?
syntax extension of javascript, produces react elements
Why must the React object be imported when authoring JSX in a module?
jsx creates react elements so you need the react object to read the jsx
How can you make Webpack and Babel work together to convert JSX into valid JavaScript?
babel loader
What is a React component?
basically a javascript function that makes react elements
What is a React component?
basically a javascript function that makes react elements
How do you define a function component in React?
function definition like javascript that returns a react object
How do you mount a component to the DOM?
root.render(element)
What are props in React?
properties, javascript expressions
How do you pass props to a component?
as a react function attribute
How do you write JavaScript expressions in JSX?
inside { } curly braces
How do you create “class” component in React?
class ClassName extends React.Components {
}
How do you access props in a class component?
this.props.property