wasAsked.

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 · Full Stack Developer · technical

Published

Year not specified · React

Community answers

No answers yet. Be the first to share your experience.

Sign in to add your answer

Related interview topics