Scrollview is not working in expo 45

Please provide the following:

  1. SDK Version:45
  2. Platforms(Android/iOS/web/all):Android
  3. Add the appropriate “Tag” based on what Expo library you have a question on.
    “Scrollview”

I am using the below code where the Scrollview is inside the view.

<View>
  <ScrollView style={{paddingHorizontal: 10}}>
    <View>
      //Some design code written here
    </View>
  </ScrollView>
</View>

This code is working fine in Expo Go- 2.19.7 and Sdk- 41, But now I have updated Sdk-45 and it is using Expo Go-2.24.6.
I also try the flex:1, flexGrow:1 properties but the content in the scrollview is stuck and not scrolling up.

Try flex: 1 in the containing view

I already try this, but not worked

Hey @fardeen_1, the scrollview responder doesn’t behave (visibly) the same way as on iOS. That is, it doesn’t have that bouncy effect on Android (that is available on iOS) with one list item or when the length of the list is not exceeding the screen.

I reproduced the code example in this snack: surprised kiwi - Snack using multiple list items. Please have a look.

Hey @amanhimself, Thank you for your solution.
I tried the same way you provide but that not worked for me, and also I noticed in the logs, I’m getting the below warning every time I open my screen.

Cannot update a component (%s) while rendering a different component (%s). To locate the bad setState() call inside %s, follow the stack trace as described in https://reactjs.org/link/setstate-in-render%s.

I’m not sure, but Is this warning cause of this unwanted behavior and If yes, Is there any way to clear this warning.

The warning you mentioned usually occurs when a state of the component is populated with data and on every props update. TLDR: you’ll have to check if that’s what’s happening and use the useEffect hook to resolve it. It might be related to your not scrolling problem but I can’t say that for sure.

You can read more about the warning and resolving it here: How to fix the "cannot update a component while rendering a different component" error in React