react-useportal
react-useportal copied to clipboard
Feature: support adding a className
Would you consider adding support for className?
e.g.
<Portal className="my-portal">
<div>My modal component</div>
</Portal>
Or if this API is not desired, then I could adjust the PR to be like this instead.
const { Portal } = usePortal({ className: 'my-portal' })
<Portal>
<div>My modal component</div>
</Portal>
I just noticed there is portalRef
. I could use that to add my className.
I will use that for now :)
This is great and exactly what I was planning on doing. See my milestones issue here.