react-useportal icon indicating copy to clipboard operation
react-useportal copied to clipboard

Feature: support adding a className

Open kunukn opened this issue 5 years ago • 2 comments

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>

kunukn avatar Dec 11 '19 10:12 kunukn

I just noticed there is portalRef. I could use that to add my className. I will use that for now :)

kunukn avatar Dec 11 '19 15:12 kunukn

This is great and exactly what I was planning on doing. See my milestones issue here.

alex-cory avatar Dec 11 '19 18:12 alex-cory