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} .. >