From 6cd5ad466f47fb2caa1003d304446a38e263caa7 Mon Sep 17 00:00:00 2001 From: Luke Jones Date: Fri, 9 Apr 2021 12:08:07 +1000 Subject: [PATCH] Don't spread props onto DOM elements, fixes #35 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. --- src/createLoadableVisibilityComponent.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/createLoadableVisibilityComponent.js b/src/createLoadableVisibilityComponent.js index c1e8fb7..ad2a950 100644 --- a/src/createLoadableVisibilityComponent.js +++ b/src/createLoadableVisibilityComponent.js @@ -77,7 +77,6 @@ function createLoadableVisibilityComponent( minHeight: "1px", minWidth: "1px" }} - {...props} ref={visibilityElementRef} > {LoadingComponent @@ -93,7 +92,6 @@ function createLoadableVisibilityComponent( return (
);