From 0d498c25d598ba7ac2715852e238f2627627371a Mon Sep 17 00:00:00 2001 From: Olivier Tassinari Date: Sun, 12 Jun 2022 18:25:00 +0200 Subject: [PATCH] simplify --- packages/typescript-to-proptypes/src/injector.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/packages/typescript-to-proptypes/src/injector.ts b/packages/typescript-to-proptypes/src/injector.ts index 7b2177d1247469..f3dd947525e8b3 100644 --- a/packages/typescript-to-proptypes/src/injector.ts +++ b/packages/typescript-to-proptypes/src/injector.ts @@ -152,10 +152,8 @@ function plugin( // key is a reserved prop name in React // e.g. https://github.com/reactjs/rfcs/pull/107 // no need to add a prop-type if we won't generate the docs for it. - if (data.prop.name === 'key') { - if (data.prop.jsDoc === '@ignore') { - return false; - } + if (data.prop.name === 'key' && data.prop.jsDoc === '@ignore') { + return false; } if (options.shouldInclude) {