rn-css 1.6.9 → 1.6.10
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 +2 -4
- package/package.json +1 -1
- package/src/styleComponent.tsx +2 -4
package/dist/styleComponent.js
CHANGED
|
@@ -109,10 +109,8 @@ const styled = (Component) => {
|
|
|
109
109
|
return newProps;
|
|
110
110
|
}, [finalStyle.textOverflow, onLayout, onMouseEnter, onMouseLeave, props.style, styleConvertedFromCSS]);
|
|
111
111
|
react_1.default.useEffect(() => () => removeStyle(hash), [hash]);
|
|
112
|
-
//
|
|
113
|
-
|
|
114
|
-
// if (em !== currentFontSize) {
|
|
115
|
-
if (styleConvertedFromCSS.fontSize) {
|
|
112
|
+
// em !== parentEm alone is a bit dangerous as the component would rerender when the font size change
|
|
113
|
+
if (em !== parentEm || finalStyle.fontSize !== undefined) {
|
|
116
114
|
return react_1.default.createElement(exports.FontSizeContext.Provider, { value: em },
|
|
117
115
|
react_1.default.createElement(Component, { ref: ref, ...props, ...newProps }));
|
|
118
116
|
}
|
package/package.json
CHANGED
package/src/styleComponent.tsx
CHANGED
|
@@ -122,10 +122,8 @@ const styled = <Props, >(Component: React.ComponentType<Props>) => {
|
|
|
122
122
|
|
|
123
123
|
React.useEffect(() => () => removeStyle(hash), [hash])
|
|
124
124
|
|
|
125
|
-
//
|
|
126
|
-
|
|
127
|
-
// if (em !== currentFontSize) {
|
|
128
|
-
if (styleConvertedFromCSS.fontSize) {
|
|
125
|
+
// em !== parentEm alone is a bit dangerous as the component would rerender when the font size change
|
|
126
|
+
if (em !== parentEm || finalStyle.fontSize !== undefined) {
|
|
129
127
|
return <FontSizeContext.Provider value={em}>
|
|
130
128
|
<Component ref={ref} {...props} {...newProps} />
|
|
131
129
|
</FontSizeContext.Provider>
|