Nativebase: ReferenceError: Can't find variable: resolvedStyle

Created on 10 Nov 2017  ·  11Comments  ·  Source: GeekyAnts/NativeBase

Hey there. I have created project using CRNA. & Later adding NativeBase as dependency.

Versions:

"expo": "^22.0.2",
"native-base": "^2.3.3",
"react": "16.0.0-beta.5",
"react-native": "^0.49.5"

App runs just fine if i'm not using any of the NativeBase Components. As soon as i import e.g. Content and later use it as <Content>SomeText</Content>

I get following error .

simulator screen shot - iphone 8 - 2017-11-10 at 19 38 26

bug

All 11 comments

@kishanio Tried a sample code didn't find anything like above

Gif

referenceerror

Problem is in an updated native-base dependency.

Lock: “native-base-shoutem-theme": “0.2.1”

As @wiedld stated it is a problem with [email protected] In connectStyle.js in getOrSetStylesInCache(), if (themeCache && themeCache[path.join(">")]) is not truthy, there will be a runtime exception as described above, bc indeed var resolvedStyle is not defined. Adding a let does all the magic.

It seems like the themeCache can get into a state where that code runs and then it breaks the app. Doesn't seem like the theme is open source, so maybe it worth taking a look @akhil-geekyants

Thanks

PR (by @AaronFriel ) for this issue https://github.com/GeekyAnts/theme/pull/4

Excellent, we identified another issue in Item.js. This PR should fix it: https://github.com/GeekyAnts/NativeBase/pull/1396

Having issues with undeclared variables here too. I confirm the PRs above tackle those issues.

Any chance those trivial fixes could be merged soon?

@remon-georgy Yes, this week

Is there a version with this fixed?

@midastouchprd Merging it today

Any news on this?

Fixed with 2.3.6

Was this page helpful?
0 / 5 - 0 ratings