我一直在尝试将网格添加到我的反应项目中,但是当我加载页面时,它给了我一个错误:
Warning: Failed propType: Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at https://github.com/facebook/prop-types/blob/master/README.md#difference-from-reactproptypes-dont-call-validator-functions Check the render method of `GridTest`.
尝试使用antd
and react-flexbox-grid
,但两个库都会产生相同的错误。
代码:
import React, { Component } from 'react';
import {Grid, Row, Col} from 'react-flexbox-grid';
export default class GridTest extends Component {
render() {
return (
<Grid>
<Row>
<Col xs={6} md={3}>Hello, world!</Col>
</Row>
</Grid>
);
}
}
对于如何解决这个问题,有任何的建议吗?我认为问题可能是由外部库未捆绑prop-types
或其他原因引起的?...