Infosys interview question

react components and types of it