All fields

“Component Composition & Children Props” in Information Technology

21 questions across 1 technology.

Information Technology

21 questions in 1 technology

#QuestionTechnologyTopicLevel
1What is the difference between passing a component as a prop and nesting it as children? React › Component Composition & Children PropsReactComponent Composition & Children PropsBeginner
2What is component composition in React and why is it useful? React › Component Composition & Children PropsReactComponent Composition & Children PropsBeginner
3How would you build a flexible component using multiple named slots instead of a single children prop? React › Component Composition & Children PropsReactComponent Composition & Children PropsAdvanced
4What is the children prop in React and how does it work? React › Component Composition & Children PropsReactComponent Composition & Children PropsIntermediate
5How does composition help avoid the problem known as prop drilling? React › Component Composition & Children PropsReactComponent Composition & Children PropsIntermediate
6How do you properly pass through extra props when writing a higher order component? React › Higher-Order Components (HOCs)ReactHigher-Order Components (HOCs)Intermediate
7What is a common naming alternative to render props, using children as a function instead? React › Render Props PatternReactRender Props PatternIntermediate
8What is a React component and what are the two main types? React › Components & JSXReactComponents & JSXBeginner
9What is a simple example of a higher order component that adds a border style to any component? React › Higher-Order Components (HOCs)ReactHigher-Order Components (HOCs)Beginner
10How do you pass data from a parent component to a child component in React? React › Props & StateReactProps & StateBeginner
11How does styled components let you write CSS directly inside your JavaScript files? React › Styling in React (CSS Modules, Styled Components & Tailwind)ReactStyling in React (CSS Modules, Styled Components & Tailwind)Intermediate
12How would you type a component's children prop correctly using TypeScript? React › TypeScript with ReactReactTypeScript with ReactIntermediate
13What is JSX and why do React developers use it? React › Components & JSXReactComponents & JSXBeginner
14How would you give a prop a default value in case the parent does not pass one? React › Props & StateReactProps & StateIntermediate
15What is the single responsibility principle and how does it apply to writing React components? React › Design Patterns in ReactReactDesign Patterns in ReactBeginner
16What is the container and presentational component pattern in React? React › Design Patterns in ReactReactDesign Patterns in ReactIntermediate
17What is the compound component pattern in React, and when is it useful? React › Design Patterns in ReactReactDesign Patterns in ReactAdvanced
18What is forwardRef and why is it needed when passing a ref to a custom component? React › Refs, useRef & forwardRefReactRefs, useRef & forwardRefAdvanced
19How would you create a reusable, generic React component using TypeScript, such as a list component that works with any data type? React › TypeScript with ReactReactTypeScript with ReactAdvanced
20Where should you place error boundaries in a real React app? React › Error BoundariesReactError BoundariesBeginner
21What is a common sign that an app's state management approach needs to be reconsidered? React › State ManagementReactState ManagementBeginner