Nativebase: ActionSheet is not usable as a native method argument in RN 0.58.0

Created on 1 Feb 2019  路  15Comments  路  Source: GeekyAnts/NativeBase

Issue Description

node 10.14.1
npm 6.4.1
react-native 0.58.0
react 16.6.3
native-base 2.8.0
expo none
xcode none

Expected behaviour

After update to RN 0.58, i expect it just working fine like before. previous RN is 0.57

Actual behaviour

When calling ActionSheet.show... it give an error like in screenshot below:

actionsheet

Is the bug present in both iOS and Android or in any one of them?

Android. IOS never tested

awaiting response

Most helpful comment

@ggdegreat @Udbhav12
The issue was due to height: this.state.length * 80, in https://github.com/GeekyAnts/NativeBase/blob/master/src/basic/Actionsheet.js Line 101...
Fixed with height: this.state.items.length * 80,
We will update that soon with next release. Thanks...
screen shot 1440-05-26 at 6 29 49 pm

All 15 comments

I am getting the exact same error

@ggdegreat @Udbhav12
The issue was due to height: this.state.length * 80, in https://github.com/GeekyAnts/NativeBase/blob/master/src/basic/Actionsheet.js Line 101...
Fixed with height: this.state.items.length * 80,
We will update that soon with next release. Thanks...
screen shot 1440-05-26 at 6 29 49 pm

Fixed with commit 13413a06907a9901900f4b8c61affbc982f7f5ed

This is the wrong fix, but you assumed it was correct just because it made the error go away, correct?
I'm going to ignore the fact that declaring styles inline and outside of StyleSheet.create is a minor performance issue according to the native-base docs.
Notice the extra space underneath the "Cancel" button in your screenshot. It's there because the height of each ListItem is not actually 80. The actionsheet looked much better before because the height property was broken and did not evaluate to what you changed it to now.

@suvenduchhatoi : Your suggestion cant fix my problem.

@bepehr Are you doing a fresh native-base installation after removing node_modules and clearing cache

@suvenduchhatoi : yes i did this steps
1 . delete node_modules folders
2 . yarn cache clean
3 . yarn
4 . edit /node_modules/native-base/src/basic/ActionSheet.js
5 . react-native run-android

but still got same error

@suvenduchhatoi : sory my mistake , i have to replace /node_modules/native-base/dist/src/basic/Actionsheet.js and Actionsheet.js.map with your commit files , it fixed now. thank you

@hoboman313 The extra space is due to less number of options as Actionsheet items in the example snippet. If you increase the number of options, and scroll down to the last option, you can see the difference...
screen shot 1440-06-01 at 7 26 41 pm

npm was no update!

npm update NativeBase 2.11.0, the problem still remain. please update npm source code

@suvenduchhatoi Any idea on when the new release containing this will be cut?

@janpieterz It's has just been released

I saw it yeah, tested and confirmed.

Focus on that <<NaN>>, for me that was causing the issue.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

nschurmann picture nschurmann  路  3Comments

kitsune7 picture kitsune7  路  3Comments

bsiddiqui picture bsiddiqui  路  3Comments

omerdn1 picture omerdn1  路  3Comments

maphongba008 picture maphongba008  路  3Comments