Skip to content

Instantly share code, notes, and snippets.

@browniefed
Created August 21, 2017 21:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save browniefed/6386466f52647f9d2d61088525b2b0af to your computer and use it in GitHub Desktop.
Save browniefed/6386466f52647f9d2d61088525b2b0af to your computer and use it in GitHub Desktop.
import React, { Component } from "react";
import { View, Text, StyleSheet } from "react-native";
class componentName extends Component {
_scrollEnabled = false;
enable = () => {
this._scrollEnabled = true;
this._scrollView.setNativeProps({
scrollEnabled: true
})
}
disable = () => {
this._scrollEnabled = false;
this._scrollView.setNativeProps({
scrollEnabled: false
})
}
render() {
return (
<View>
<ScrollView
scrollEnabled={this._scrollEnabled}
/>
</View>
);
}
}
export default componentName;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment