A utility that creates the right pan handlers for you to lock the direction of your nested scroll views
npm install react-native-scroll-lockyEver found yourself in need of a way to nest 2 scroll views (or list views, or flat lists, or virtualised lists)?
Then you know that the lists are not smart enough to know when to respond to the pan gestures.
This simple utility makes sure that the component you add it to only responds to a specific direction gesture,
a.k.a we LOCK the list pan responses only to the direction we want it to respond to.
npm install react-native-scroll-locky
``
import RNLocky from "react-native-scroll-locky";
class AClass extends Component {
constructor(props) {
super(props);
this.directionLockPanHandler = new ScrollDirectionLockManager(
ScrollDirectionLockManager.Direction.HORIZONTAL,
// or ScrollDirectionLockManager.Direction.VERTICAL
);
}
render() {
return (
>
...
);
}
}
``