Open anupkmaharjan opened 4 years ago
I believe the current implementation of DraxScrollView
does not provide a way to access the internal ScrollView
ref. I think it needs to be enhanced to support the functionality you're requesting.
I have found the solution to access ScrollView ref by exporting onScrollRefNew on line number 30.
Previous Code // Set the ScrollView and node handle refs.
const setScrollViewRefs = react_1.useCallback((ref) => {
scrollRef.current = ref;
nodeHandleRef.current = ref && react_native_1.findNodeHandle(ref);
}, []);
New Code // Set the ScrollView and node handle refs.
const setScrollViewRefs = react_1.useCallback((ref) => {
scrollRef.current = ref;
nodeHandleRef.current = ref && react_native_1.findNodeHandle(ref);
return onScrollRefNew?.(ref);
}, [onScrollRefNew]);
I will take a look at this when I am able. Thank you.
Any progress on this?
PR #107 is in progress and should provide this functionality
I am trying to make the card center of the DraxScrollView which will have the dynamic width based upon the number of the cards DraxScrollView is acquiring.
I have used ` <DraxScrollView contentContainerStyle={[styles.receivedZone,]} alwaysBounceVertical={true} maximumZoomScale={10} minimumZoomScale={-2} directionalLockEnabled={false} horizontal={true} ref={(ref) => this.draxScrollViewRef = ref.getNodes()}
The reference is then used on ` componentDidMount = async () => {
But the end result is
TypeError: _this.draxScrollViewRef.getNodes is not a function. (In '_this.draxScrollViewRef.getNodes()', '_this.draxScrollViewRef.getNodes' is undefined)
What can be done?