React-native on IOS: cannot adjust current top of stack beyond available views

后端 未结 2 1353
离开以前
离开以前 2020-12-21 16:59

When writing a component, I suddenly got a very strange error in my IOS simulator: \"cannot adjust current top of stack beyond available views\"

Here is my code:

相关标签:
2条回答
  • 2020-12-21 17:05

    Okay, so it turns out this happens in React-Native when you misspell the component name. My imported class, Separator should have been spelled Seperator and my linter and the build system did not catch the error. Apparently if you try to use an object that is undefined in React-native, this is the error you get!

    0 讨论(0)
  • 2020-12-21 17:07

    Expanding on the observation you made, this error can occur more generally whenever you reference or misspell a name. It is not limited to only Component names.

    for example, if you create a styles object to hold your styles, but accidentally refer to it as style, then you will also see this error thrown.

    0 讨论(0)
提交回复
热议问题