How can you access the context data within a component using the Context API?

By importing the context and calling its getData() method

By wrapping the component with the <Context.Consumer> component.

By using the context property within class componentsBy using the useContext hook within a functional component

By using the useContext hook within a functional component

Verified Answer
Correct Option - d

To get all Infosys Certified React Expert Exam questions Join Telegram Group https://grateful.prepflix.in/infy-lex-pdfs

Telegram