Reactjs React:获取组件实例计数(以在React引导中正确调整大小)

Reactjs React:获取组件实例计数(以在React引导中正确调整大小),reactjs,react-bootstrap,Reactjs,React Bootstrap,我需要获得组件的计数(以便在React Boostrap中正确调整它们的大小)。组件是 Infographic.js示例 export default function Infographic(props) { return ( <Col lg={6} className="home-tile"> <img src={props.icon} className="home-tile-img"

我需要获得
组件的计数(以便在React Boostrap中正确调整它们的大小)。组件是

Infographic.js示例

export default function Infographic(props) {
    return (
        <Col lg={6} className="home-tile">
            <img src={props.icon} className="home-tile-img" alt=""/>
            <div className="home-tile-content">
                <h2>{props.title}</h2>
                <p>{props.text}</p>
            </div>
        </Col>
   );
}
<Infographic icon={laptopHouse} title="Infographic 1" text="My Text 1" />
<Infographic icon={contractHouse} title="Infographic 2" text="My Text 2" />
最大值=3

那么,在我的
Infographic.js
组件中有没有一种计算方法

1 Component:  no {lg}, just use <Col> directly
2 Components: <Col lg={6} .. >
3 Components: <Col lg={4} .. >