Skip to content

Commit 7dd09d5

Browse files
author
Mohit
committed
v0.1.4
1 parent 91561a9 commit 7dd09d5

3 files changed

Lines changed: 10 additions & 4 deletions

File tree

build/Sheet.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff 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

example/App.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import React from "react";
22
import { ThemeProvider } from "./style";
33
import Screen from "./screens";
4-
import { StatusBar } from "react-native";
54

65
export default function App() {
76
return (

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
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",

0 commit comments

Comments
 (0)