react-native-steve icon indicating copy to clipboard operation
react-native-steve copied to clipboard

Cannot read property 'layout' of undefined

Open braincore opened this issue 2 years ago • 5 comments

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.

braincore avatar Dec 03 '21 21:12 braincore

@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 :)

tsdmrfth avatar Dec 03 '21 21:12 tsdmrfth

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!

braincore avatar Dec 03 '21 22:12 braincore

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

tsdmrfth avatar Dec 03 '21 22:12 tsdmrfth

@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. https://github.com/tsdmrfth/react-native-steve/pull/27

tsdmrfth avatar Dec 05 '21 20:12 tsdmrfth

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?

braincore avatar Dec 08 '21 20:12 braincore