Interview Q&A / React

INTERVIEW Q&A · 58 QUESTIONS

React interview questions

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

  1. How do createContext, Provider and useContext work together?

    createContext makes a context object with a default value. A Provider higher in the tree supplies the real value. Any component below it calls useContext(MyContext) to read the nearest provider's value, with no props passed through the middle layers.

    BeginnerQuick answer1 min read