-
Notifications
You must be signed in to change notification settings - Fork 24.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How you support orientation changes on FlatList without changing columns on the fly? #15944
Comments
Did you figure out how to do it? |
@facebook-github-bot no-template |
Hey, thanks for reporting this issue! It looks like your description is missing some necessary information, or the list of reproduction steps is not complete. Can you please add all the details specified in the Issue Template? This is necessary for people to be able to understand and reproduce the issue being reported. I am going to close this, but feel free to open a new issue with the additional information provided. Thanks! See "What to Expect from Maintainers" to learn more. |
export default class Jogar extends Component<{}> { prepData = () => { renderItem = ({ item }) => { onLayout(e) {
} constructor(props) {
} render() {
} |
Having same issue. Don't understand why, I am re-rendering the child with the FlatList with a new number of columns. Is there some magic to work around this? |
Sombody suggest do use But this didn't work for me, here is what work for me: |
I remember using
FlatList
when it didn't have this check:So basically I wrapped the
FlatList
in aView
withonLayout
prop, and when the width of screen changes (from portrait <-> layout) I would change the number of columns (and some other calculations). This is not allowed now, so what it forces me to do is changing thekey
prop of theFlatList
... This renders a completely new list, losing the scroll position and with a big delay even in production.Any workarounds, thoughts ?
The text was updated successfully, but these errors were encountered: