Interview Q&A / React

INTERVIEW Q&A · 58 QUESTIONS

React interview questions

Rendering, state, hooks, keys and effects, explained with small examples.

  1. Why can a React component not return two sibling elements without a wrapper?

    A function can return only one value, and JSX tags compile to one call each. Wrap siblings in a parent element or a Fragment (<>...</>), which groups them without adding an extra DOM node.

    BeginnerQuick answer1 min read