wasAsked.

React interview questions and answers

Explore react interview questions and answers. Read questions shared by candidates and compare community answers before your next interview.

Browse interview topics · Browse companies

Questions

Build a React search component. There is a text input bound to React state (controlled). When the user types, wait 400ms after they stop typing, then call GET /api/employees?q=term. Rules: if the trimmed query length is less than 2, do not call the API — clear results and show nothing or a hint 'Type at least 2 characters'. While a request is in flight show 'Searching…'. If the user types again before the previous request finishes, ignore or abort the old response so an older slow response cannot overwrite newer results. On error show a friendly message. Please implement this with hooks only

PwC · not-specified · 0 answers

Year not specified · React