Javascript – Get nth position of the child component in React?
I have a PagesContainer component that renders multiple Page components like this: <PagesContainer> <Page /> <Page /> <Page /> <Page /> </PagesContainer> I want each Page component to know its respective page number (e.g., 1, 2, 3, 4). I preferably…