Convert GeminiScrollbarWrapper to stateless component

pull/21833/head
Luke Barnard 2018-03-21 16:00:50 +00:00
parent 39e9d52c04
commit 2ffcad0981
1 changed files with 11 additions and 15 deletions

View File

@ -14,11 +14,9 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
import React from 'react';
import GeminiScrollbar from 'react-gemini-scrollbar';
class GeminiScrollbarWrapper extends React.Component {
render() {
function GeminiScrollbarWrapper(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.
@ -26,11 +24,9 @@ class GeminiScrollbarWrapper extends React.Component {
// 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={this.props.wrappedRef} forceGemini={true} {...this.props}>
{ this.props.children }
return <GeminiScrollbar ref={props.wrappedRef} forceGemini={true} {...props}>
{ props.children }
</GeminiScrollbar>;
}
}
export default GeminiScrollbarWrapper;