Tanu has a requirement of fetching the list of top performers' details and displaying it on the load of the view. Below is the path which she can use:

http://localhost:3000/retreiveTopPerformer

Once the details are fetched, she has to display only the first 2 performer details.Choose the correct option through which she can achieve this requirement? (Assume all the required set up is done)

console.log("Form submitted")
const [employees, setEmployees]=useState([]); useEffect(()=>{ axios.post("http://localhost:3000/retreiveTopPerformer") .then(res => { setEmployees(res.data.slice(0,2) ); },[])});
const [employees, setEmployees]=useState([]); useEffect(()=>{ axios.put("http://localhost:3000/retreiveTopPerformer") .then(res => { setEmployees(res.data.slice(0,2) ); },[])});
const [employees, setEmployees]=useState([]); useEffect(()=>{ axios.post("http://localhost:3000/retreiveTopPerformer") .then(res => { setEmployees('res.data') ); },[])});
Verified Answer
Correct Option - a

To get all Infosys Certified React Professional Exam questions Join Telegram Group https://rebrand.ly/lex-telegram-236dee

Telegram