I need Row
s children to all be instances of the Col
component:
The following code worked when Row and Col were in the same file, but when I import Col into Row I get this error:
Warning: Failed prop type: Cannot call a class as a function
How can variables and imports be used in propType definitions? (building with webpack)
import React from 'react';
import PropTypes from 'prop-types';
import Col from './Col';
export default class Row extends React.Component {
static propTypes = {
children: PropTypes.oneOfType([
PropTypes.shape({ type: Col }),
PropTypes.arrayOf(PropTypes.shape({ type: Col }))
]).isRequired,
......