rn-css 1.6.16 → 1.6.18

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.
@@ -48,9 +48,9 @@ function cssToRNStyle(css, units = {}) {
48
48
  height: 100,
49
49
  rem: 16,
50
50
  px: 1,
51
- pt: 72 / 96,
51
+ pt: 96 / 72,
52
52
  in: 96,
53
- pc: 9,
53
+ pc: 16,
54
54
  cm: 96 / 2.54,
55
55
  mm: 96 / 25.4,
56
56
  ...units
package/dist/useTheme.js CHANGED
@@ -23,8 +23,10 @@ exports.useTheme = useTheme;
23
23
  * @returns A component with the theme prop
24
24
  */
25
25
  const withTheme = (Component) => {
26
- const theme = (0, exports.useTheme)();
27
- const ThemedComponent = react_1.default.forwardRef((props, ref) => react_1.default.createElement(Component, { ref: ref, theme: theme, ...props }));
26
+ const ThemedComponent = react_1.default.forwardRef((props, ref) => {
27
+ const theme = (0, exports.useTheme)();
28
+ return react_1.default.createElement(Component, { ref: ref, theme: theme, ...props });
29
+ });
28
30
  ThemedComponent.displayName = 'ThemedComponent';
29
31
  return ThemedComponent;
30
32
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rn-css",
3
- "version": "1.6.16",
3
+ "version": "1.6.18",
4
4
  "scripts": {
5
5
  "test": "jest",
6
6
  "prepare": "tsc",
@@ -46,9 +46,9 @@ export function cssToRNStyle (css: string, units: { em?: number, width?: number,
46
46
  height: 100,
47
47
  rem: 16,
48
48
  px: 1,
49
- pt: 72 / 96,
49
+ pt: 96 / 72,
50
50
  in: 96,
51
- pc: 9,
51
+ pc: 16,
52
52
  cm: 96 / 2.54,
53
53
  mm: 96 / 25.4,
54
54
  ...units
package/src/useTheme.tsx CHANGED
@@ -20,8 +20,10 @@ export const useTheme = () => React.useContext(SharedValue)
20
20
  * @returns A component with the theme prop
21
21
  */
22
22
  export const withTheme = <T, >(Component: React.ComponentType<T>) => {
23
- const theme = useTheme()
24
- const ThemedComponent = React.forwardRef<React.Component, T>((props: T, ref) => <Component ref={ref} theme={theme} {...props} />)
23
+ const ThemedComponent = React.forwardRef<React.Component, T>((props: T, ref) => {
24
+ const theme = useTheme()
25
+ return <Component ref={ref} theme={theme} {...props} />
26
+ })
25
27
  ThemedComponent.displayName = 'ThemedComponent'
26
28
  return ThemedComponent
27
29
  }