React.JS Flashcards
What is JSX?
JSX is a syntax extension to JavaScript which helps describe what the UI should look like in HTMLish style.
Why must the React object be imported when authoring JSX in a module?
React and JSX go hand in hand. JSX creates react elements.
How can you make Webpack and Babel work together to convert JSX into valid JavaScript?
add babel as a loader under the webpack exports object and add the jsx transform plugin so that it compiles the JSX to JavaScript.
What is a React component?
They are JavaScript functions that return React elements describing what should appear on the screen.
How do you define a function component in React?
define a function then use JSX to create the dom elements you need for that component
How do you mount a component to the DOM?
using the render method of the ReactDOM object
What are props in React?
it is the object you pass through a element creation that lists attributes and children
How do you pass props to a component?
as a parameter in the component function definition
How do you write JavaScript expressions in JSX?
by surrounding them in curly braces.