Skip to content
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

ColumnWrapperStyle not supported for single column lists #2630

Open
1 task done
oliviercperrier opened this issue Jan 22, 2024 · 0 comments
Open
1 task done

ColumnWrapperStyle not supported for single column lists #2630

oliviercperrier opened this issue Jan 22, 2024 · 0 comments
Labels

Comments

@oliviercperrier
Copy link

oliviercperrier commented Jan 22, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Describe the issue

Describe the bug
I get this error whenever i try using the Flatlist component from react native, and this only happen when running the web verison of my app (expo 50 and react-native 0.73.2)

AppEntry.bundle?platform=web&dev=true&hot=false&lazy=true&transform.engine=hermes&transform.routerRoot=app:1123 Uncaught Invariant Violation: columnWrapperStyle not supported for single column lists
    at invariant (http://localhost:8081/node_modules/expo/AppEntry.bundle?platform=web&dev=true&hot=false&lazy=true&transform.engine=hermes&transform.routerRoot=app:1123:17)
    at FlatList._checkProps (http://localhost:8081/node_modules/expo/AppEntry.bundle?platform=web&dev=true&hot=false&lazy=true&transform.engine=hermes&transform.routerRoot=app:43245:34)
    at new FlatList (http://localhost:8081/node_modules/expo/AppEntry.bundle?platform=web&dev=true&hot=false&lazy=true&transform.engine=hermes&transform.routerRoot=app:43089:13)
    at constructClassInstance (http://localhost:8081/node_modules/expo/AppEntry.bundle?platform=web&dev=true&hot=false&lazy=true&transform.engine=hermes&transform.routerRoot=app:24370:24)
    at updateClassComponent (http://localhost:8081/node_modules/expo/AppEntry.bundle?platform=web&dev=true&hot=false&lazy=true&transform.engine=hermes&transform.routerRoot=app:28981:11)
    at beginWork (http://localhost:8081/node_modules/expo/AppEntry.bundle?platform=web&dev=true&hot=false&lazy=true&transform.engine=hermes&transform.routerRoot=app:30616:22)
    at beginWork$1 (http://localhost:8081/node_modules/expo/AppEntry.bundle?platform=web&dev=true&hot=false&lazy=true&transform.engine=hermes&transform.routerRoot=app:35556:20)
    at performUnitOfWork (http://localhost:8081/node_modules/expo/AppEntry.bundle?platform=web&dev=true&hot=false&lazy=true&transform.engine=hermes&transform.routerRoot=app:34826:18)
    at workLoopSync (http://localhost:8081/node_modules/expo/AppEntry.bundle?platform=web&dev=true&hot=false&lazy=true&transform.engine=hermes&transform.routerRoot=app:34749:11)
    at renderRootSync (http://localhost:8081/node_modules/expo/AppEntry.bundle?platform=web&dev=true&hot=false&lazy=true&transform.engine=hermes&transform.routerRoot=app:34722:13)

I saw that for some reason, columnWrapperStyle is set with an empty array by default. same for other props, but i set none of these props with any value:

Screenshot 2024-01-21 at 10 52 01 PM

this empty array seems to be the reason why this error is thrown. If it was set to undefined (which should be the case since i dont set any of there props) i suspect everything would work.

Because columnWrapperStyle is not undefined, this part of the code raises the error: https://github.com/necolas/react-native-web/blob/master/packages/react-native-web/src/vendor/react-native/FlatList/index.js#L489

Expected behavior

Be able to use the FlatList without error.

Steps to reproduce

  1. Clone repo
  2. npm i
  3. npm run web

Test case

https://github.com/oliviercperrier/repro-ColumnWrapperStyle

Additional comments

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant