Skip to content

Conversation

@mnajdova
Copy link
Owner

Comment on lines 15 to 22
const defaultPropType = Component?.propTypes?.[propFullNameSafe];
let defaultPropTypeVal = null;

if(defaultPropType) {
console.log("Default prop type existed");
defaultPropTypeVal = defaultPropType(props, propName, componentName, location, propFullName)
}

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Properties in Component.propTypes (e.g. PropTypes.string) are referred to as "type checkers" or "validators". And then you could name their return value validatorResult or typeCheckerResult.

The current naming seems overly generic to me. Especially looking at the return statement "return defaultPropTypeVal".

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Renamed to defaultTypeChecker & defaultTypeCheckerResult. I use the default prefix, as we are not defining a new type checking for the property

@mnajdova mnajdova merged commit 7da608c into feat/grid-migrate-to-emotion Jan 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants