rn-css 1.5.2 → 1.5.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/styleComponent.js +1 -1
- package/package.json +1 -1
- package/src/styleComponent.tsx +1 -1
package/dist/styleComponent.js
CHANGED
|
@@ -17,7 +17,7 @@ const styleMap = {};
|
|
|
17
17
|
// We use this to share value within the component (Theme, Translation, whatever)
|
|
18
18
|
exports.SharedValue = react_1.default.createContext(undefined);
|
|
19
19
|
function buildCSSString(chunks, functs, props, shared) {
|
|
20
|
-
let computedString = chunks.map((chunk, i) => ([chunk, (functs[i] instanceof Function) ? functs[i]({
|
|
20
|
+
let computedString = chunks.map((chunk, i) => ([chunk, (functs[i] instanceof Function) ? functs[i]({ shared, theme: shared, ...props }) : functs[i]])).flat().join('');
|
|
21
21
|
if (props.rnCSS)
|
|
22
22
|
computedString += props.rnCSS.replace(/=/gm, ':') + ';';
|
|
23
23
|
return computedString;
|
package/package.json
CHANGED
package/src/styleComponent.tsx
CHANGED
|
@@ -25,7 +25,7 @@ type OptionalProps = {
|
|
|
25
25
|
style?: StyleProp<any>;
|
|
26
26
|
}
|
|
27
27
|
function buildCSSString<T extends { rnCSS?: string }> (chunks: TemplateStringsArray, functs: (Primitive | Functs<T>)[], props: T, shared: unknown) {
|
|
28
|
-
let computedString = chunks.map((chunk, i) => ([chunk, (functs[i] instanceof Function) ? (functs[i] as Functs<T>)({
|
|
28
|
+
let computedString = chunks.map((chunk, i) => ([chunk, (functs[i] instanceof Function) ? (functs[i] as Functs<T>)({ shared, theme: shared, ...props }) : functs[i]])).flat().join('')
|
|
29
29
|
if (props.rnCSS) computedString += props.rnCSS.replace(/=/gm, ':') + ';'
|
|
30
30
|
return computedString
|
|
31
31
|
}
|