Open reintroducing opened 1 year ago
Hey @reintroducing , can you share a codespace sample? like a stackblitz link? Reference: https://stackblitz.com/
@himanshu007-creator Is there a pre-existing template set up already with the rules in place for this repo? Or do I have to create a new one to demonstrate this issue?
You can create a blank project to demonstrate the code that you are referring to.
@himanshu007-creator right, i guess what i meant is if there is a pre-existing template that takes care of the setup of defining eslint, adding this plugin, and being ready to show any subsequent issues that may be present, but i'm assuming there isn't, so i'll create one from scratch.
Yeah you would have to create a fresh one. Sorry for my misinterpretation 🙂
Here you go: https://stackblitz.com/edit/vitejs-vite-xkspmk
I updated the title because its actually when createPortal is used within a forwarded ref. FooNoPortal.jsx
and FooPortal.jsx
are identical except that the NoPortal doesn't create a portal and the other does. The one with the forwarded ref and the portal produces the error in the terminal:
src/FooPortal.jsx(10,3): 'name' PropType is defined but prop is never used react/no-unused-prop-types
@himanshu007-creator just following up to see if the SB link above worked for you and you are able to verify this is a real issue?
We're facing false positives in our project too
I've got a component where the containing div is wrapped with
createPortal
. If I remove the createPortal, all of my propTypes are correctly used, but if I re-add the createPortal to surround the div, all of my propTypes get marked as no-unused-prop-types. Not sure whats going on here but figured I'd point it out in case nobody has ever reported this (which doesn't seem anyone has, I searched both open and closed issues with no success around this).