Merge pull request #1824 from matrix-org/luke/fix-wrappedRef-warning

Fix warning "Unknown prop `wrappedRef` on <div> tag..."
This commit is contained in:
David Baker 2018-04-05 17:49:35 +01:00 committed by GitHub
commit 28bf76b319
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -18,6 +18,8 @@ import React from 'react';
import GeminiScrollbar from 'react-gemini-scrollbar';
function GeminiScrollbarWrapper(props) {
const {wrappedRef, ...wrappedProps} = props;
// Enable forceGemini so that gemini is always enabled. This is
// to avoid future issues where a feature is implemented without
// doing QA on every OS/browser combination.
@ -25,7 +27,7 @@ function GeminiScrollbarWrapper(props) {
// By default GeminiScrollbar allows native scrollbars to be used
// on macOS. Use forceGemini to enable Gemini's non-native
// scrollbars on all OSs.
return <GeminiScrollbar ref={props.wrappedRef} forceGemini={true} {...props}>
return <GeminiScrollbar ref={wrappedRef} forceGemini={true} {...wrappedProps}>
{ props.children }
</GeminiScrollbar>;
}