React-native-web: ScrollView: support for contentOffset prop

Created on 5 Mar 2019  路  5Comments  路  Source: necolas/react-native-web

when I use ScrollView work in Carousel Component. I need the prop. I want to know why not support?

Most helpful comment

Please

All 5 comments

image
this prop...

Any news regarding this?

Any news regarding this?

@necolas

Please

For the time being I've gotten around this by using useEffect() on the scrollview ref and setting scrollTo without any animation on screen load.

import React, { useEffect, useRef } from 'react'
import { Text, ScrollView } from 'react-native'

export default function ScrollViewTest(props) {
    const scrollView = useRef();

    useEffect(() => {
        scrollView.current.scrollTo({x: spacing, animated:false})
    }, [])

    return (
        <ScrollView ref={scrollView}>
            <Text>Testing...</Text>
        </Scrollview>
    )
}
Was this page helpful?
0 / 5 - 0 ratings

Related issues

tgh picture tgh  路  3Comments

rohanprabhu picture rohanprabhu  路  3Comments

MovingGifts picture MovingGifts  路  3Comments

zhangking picture zhangking  路  3Comments

blairio picture blairio  路  3Comments