FlashKeepers

Web Development · College · College and University

React I: Components, Props and State

JSX, function components, props, state, events, conditional rendering, lists and keys, and lifting state up.

About this set

40 basic cards for College Web Development. Set 1 of 3 in React. It opens with "What is JSX?" and "JSX code transpiles to what function calls?". Study it alongside the other College sets below.

40 cards · basic cards · AI-written, checked twice. Edit anything.

Study this set free Look inside first Get FlashKeepers for iPhone

Opens in your browser, no account. Get the iPhone and iPad app · Android app

What is JSX?
Show answerA syntax extension to JavaScript that lets you write HTML-like code to describe UI elements
JSX code transpiles to what function calls?
Show answerReact.createElement() calls
How do you embed JavaScript expressions in JSX?
Show answerWrap them in curly braces: {expression}
In JSX, what HTML attribute name becomes className?
Show answerclass
Do inline CSS objects in JSX use dashes or camelCase?
Show answercamelCase: backgroundColor, not background-color
What is a React function component?
Show answerA JavaScript function that returns JSX
What must every function component return?
Show answerA JSX element or null
How should React component names be formatted?
Show answerPascalCase: MyComponent, not myComponent
Do function components use lifecycle methods like componentDidMount?
Show answerNo, use the useEffect hook instead
What are props?
Show answerArguments passed to a component that contain data the component should display
Are props mutable within a component?
Show answerNo, props are read-only and cannot be modified
How do you access props in a function component?
Show answerThey are passed as the first parameter: function MyComponent(props) {}
What value does a prop have if it is not provided to a component?
Show answerundefined
How do you pass props to a component?
Show answerAdd attributes in the JSX: <MyComponent name="John" age={30} />
What is prop drilling?
Show answerPassing props through intermediate components that do not use them to reach nested components

25 more cards in the app

Study this set free