react-focus-trap icon indicating copy to clipboard operation
react-focus-trap copied to clipboard

Forward all properties.

Open mareksuscak opened this issue 7 years ago • 2 comments

It's a good rule of thumb to forward all unrecognized properties that were passed down.

mareksuscak avatar Oct 01 '17 01:10 mareksuscak

Which part of the component should we forward unrecognized props to? This is the structure of a focus trap:

<div class="focus-trap-wrapper">
  <div class="focus-trap-backdrop" />
  <div class="focus-trap">
    {children}
  </div>
</div>

Ignoring the backdrop, should unrecognized props be forwarded to focus-trap-wrapper, or focus-trap?

nhunzaker avatar Nov 02 '17 12:11 nhunzaker

That's a good question. I guess it depends. I usually pass them to the top level container. It's worth to mention, though, that it might not be the perfect solution in all cases.

mareksuscak avatar Nov 02 '17 15:11 mareksuscak