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

Cannot read property 'layout' of undefined #26

Open
braincore opened this issue Dec 3, 2021 · 5 comments
Open

Cannot read property 'layout' of undefined #26

braincore opened this issue Dec 3, 2021 · 5 comments

Comments

@braincore
Copy link
Contributor

Don't have a reproduction for you, but I've observed when updating data, the following error:

TypeError Cannot read property 'layout' of undefined
This error is located at:
    in Item (at Steve.js:107)
    in Items (at Steve.js:200)
    in RCTView (at View.js:32)
    in View (at createAnimatedComponent.js:448)
    in AnimatedComponent(View) (at createAnimatedComponent.js:459)
    in AnimatedComponentWrapper (at Steve.js:199)
    in RCTView (at View.js:32)
    in View (at createAnimatedComponent.js:448)
    in AnimatedComponent(View) (at createAnimatedComponent.js:459)
    in AnimatedComponentWrapper (at Steve.js:198)
    in PanGestureHandler (at Steve.js:195)

I've also noticed that layout recalculation isn't performed when updating data (items may overlap each other). The library should support data updates, or at a minimum warn users.

@tsdmrfth
Copy link
Owner

tsdmrfth commented Dec 3, 2021

@braincore Hi. Thanks for letting me know. I really don't have free time to solve the problems in the project and can't promise when I can fix the problem. Contibutions are welcome :)

@braincore
Copy link
Contributor Author

No time here either :). I've already worked around the issue by unmounting/remounting the component when data changes. Hopefully anyone else who encounters this issue will see this. Thanks a lot for this project!

@tsdmrfth
Copy link
Owner

tsdmrfth commented Dec 3, 2021

@braincore Thanks for your understanding. I'll take some time and try to figure it out tomorrow.

@tsdmrfth
Copy link
Owner

tsdmrfth commented Dec 5, 2021

@braincore Hi! Found a good solution to the issue. Please pull the changes and give it a try to see if it works for you too meanwhile I'll try to fix the other issues. #27

@braincore
Copy link
Contributor Author

Metro has trouble compiling.

error: Error: Unable to resolve module hooks from /Users/ken/src/superego/mobile/IntertimesMobile/node_modules/react-native-steve/src/Steve.js: hooks could not be found within the project or in these directories:
  node_modules
  ../../../node_modules

Why did you add hooks as a sub-package?

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

No branches or pull requests

2 participants