Skip to content

Commit f72490c

Browse files
author
Moroine Bentefrit
committed
Add back containsSpread
1 parent 39eddbe commit f72490c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/util/propTypes.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ module.exports = function propTypesInstructions(context, components, utils) {
128128

129129
ObjectTypeAnnotation(annotation, parentName, seen) {
130130
let containsUnresolvedObjectTypeSpread = false;
131+
let containsSpread = false;
131132
const containsIndexers = Boolean(annotation.indexers && annotation.indexers.length);
132133
const shapeTypeDefinition = {
133134
type: 'shape',
@@ -152,12 +153,15 @@ module.exports = function propTypesInstructions(context, components, utils) {
152153
} else {
153154
Object.assign(shapeTypeDefinition, types.children);
154155
}
156+
containsSpread = true;
155157
});
156158

157159
// Mark if this shape has spread or an indexer. We will know to consider all props from this shape as having propTypes,
158160
// but still have the ability to detect unused children of this shape.
159161
shapeTypeDefinition.containsUnresolvedSpread = containsUnresolvedObjectTypeSpread;
160162
shapeTypeDefinition.containsIndexers = containsIndexers;
163+
// Deprecated: containsSpread is not used anymore in the codebase, ensure to keep API backward compatibility
164+
shapeTypeDefinition.containsSpread = containsSpread;
161165

162166
return shapeTypeDefinition;
163167
},

0 commit comments

Comments
 (0)