mirror of
https://github.com/zoriya/react-native-web.git
synced 2026-06-03 18:52:07 +00:00
[fix] StyleSheet resolving for 'number' style
This commit is contained in:
@@ -12,7 +12,7 @@ import mapKeyValue from '../../modules/mapKeyValue';
|
|||||||
import prefixInlineStyles from './prefixInlineStyles';
|
import prefixInlineStyles from './prefixInlineStyles';
|
||||||
import ReactNativePropRegistry from '../../modules/ReactNativePropRegistry';
|
import ReactNativePropRegistry from '../../modules/ReactNativePropRegistry';
|
||||||
|
|
||||||
const prefix = 'r';
|
const prefix = 'r-';
|
||||||
const SPACE_REGEXP = /\s/g;
|
const SPACE_REGEXP = /\s/g;
|
||||||
const ESCAPE_SELECTOR_CHARS_REGEXP = /[(),":?.%\\$#*]/g;
|
const ESCAPE_SELECTOR_CHARS_REGEXP = /[(),":?.%\\$#*]/g;
|
||||||
|
|
||||||
@@ -64,7 +64,7 @@ const registerStyle = (id, flatStyle) => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
const key = `${prefix}-${id}`;
|
const key = `${prefix}${id}`;
|
||||||
resolvedPropsCache[key] = { className };
|
resolvedPropsCache[key] = { className };
|
||||||
|
|
||||||
return id;
|
return id;
|
||||||
@@ -210,7 +210,7 @@ const StyleRegistry = {
|
|||||||
// if (!hasValidKey) { key = null; }
|
// if (!hasValidKey) { key = null; }
|
||||||
|
|
||||||
// cache resolved props when all styles are registered
|
// cache resolved props when all styles are registered
|
||||||
const key = isArrayOfNumbers ? `${prefix}-${flatArray.join('-')}` : null;
|
const key = isArrayOfNumbers ? `${prefix}${flatArray.join('-')}` : null;
|
||||||
|
|
||||||
return resolvePropsIfNeeded(key, flatArray);
|
return resolvePropsIfNeeded(key, flatArray);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user