caglardurmus / react-native-insta-story

Story component for React Native
MIT License
177 stars 82 forks source link

dynamic data not working #25

Closed Standin-Alone closed 2 years ago

onneti2013 commented 2 years ago

No description provided.

I had the same problem and it can be solved with a setstate of already loaded data

const [storiesloaded, setStoriesloaded] = useState(0);

        { storiesloaded != 0 &&
            <InstaStory data={stories}
            duration={10}
            onStart={item => console.log(item)}
            onClose={item => console.log('close: ', item)}
            customSwipeUpComponent={<View>
                                <Text>Swipe</Text>
                            </View>}
            style={{marginTop: 30}}/>
        }

Just after your dynamic data is loaded you change storiesloaded to 1