rn-css 1.6.16 → 1.6.17

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/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.17",
4
4
  "scripts": {
5
5
  "test": "jest",
6
6
  "prepare": "tsc",
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
  }