stratiformltd / react-loadable-visibility

A wrapper around react-loadable and @loadable/component to load elements once they are visible on the page.
BSD 3-Clause "New" or "Revised" License
1.01k stars 31 forks source link

Don't spread props onto DOM elements, fixes #35 #41

Open luke-j opened 3 years ago

luke-j commented 3 years ago

Currently all props are being spread onto the wrapping div elements, this is causing react to complain about unknown props on DOM elements. I can't see an obvious reason for the spread given that props intended for the lazy-loaded component should not need to be present on a wrapper element. So, this PR removes the spreads entirely.

cc. @tazsingh