File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -29,8 +29,15 @@ class Sheet {
2929 Object . keys ( styles ) . forEach ( ( styleKey ) => {
3030 const styleValue = styles [ styleKey ] ;
3131 if ( styleValue && Array . isArray ( styleValue ) ) {
32- const selectedValue = styleValue [ activeIndex ] ;
33- styles [ styleKey ] = selectedValue ;
32+ // length is checked to allow undefined to set as styleValue
33+ if ( activeIndex >= styleValue . length ) {
34+ const selectedValue = styleValue [ styleValue . length - 1 ] ;
35+ styles [ styleKey ] = selectedValue ;
36+ }
37+ else {
38+ const selectedValue = styleValue [ activeIndex ] ;
39+ styles [ styleKey ] = selectedValue ;
40+ }
3441 }
3542 } ) ;
3643 // @ts -ignore
Original file line number Diff line number Diff line change 11import React from "react" ;
22import { ThemeProvider } from "./style" ;
33import Screen from "./screens" ;
4- import { StatusBar } from "react-native" ;
54
65export default function App ( ) {
76 return (
Original file line number Diff line number Diff line change 11{
22 "name" : " react-native-sugar-style" ,
3- "version" : " 0.1.3 " ,
3+ "version" : " 0.1.4 " ,
44 "description" : " React Native Stylesheet alternative with theme support" ,
55 "author" : " mohit23x" ,
66 "license" : " MIT" ,
You can’t perform that action at this time.
0 commit comments