-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Closed
Labels
Description
Here's the code:
import React from 'react';
import PropTypes from 'prop-types';
import { forbidExtraProps } from 'airbnb-prop-types';
export const CustomShape = PropTypes.shape({});
export default function withWrapper(Component) {
class Wrapper extends React.Component {
}
Wrapper.propTypes = forbidExtraProps({
...Component.propTypes,
phrases: CustomShape.isRequired,
});
Wrapper.childContextTypes = {
...Component.contextTypes,
phrases: CustomShape.isRequired,
};
Wrapper.displayName = `withWrapper(${Component.displayName || Component.name})`;
return Wrapper;
}
The error:
Typo in declared prop type: isRequired react/no-typos
This shouldn't error, both because it's not a typo, and because PhraseShape
isn't a component.
therealtbs, selbekk, KevinBon, octet-stream and orzechowskid