@callstack/react-theme-provider
Advanced tools
Comparing version 2.0.1 to 2.0.2
@@ -73,17 +73,6 @@ "use strict"; | ||
return React.createElement(ThemeContext.Consumer, null, function (theme) { | ||
var merged = _this2._merge(theme, rest.theme); | ||
var element = React.createElement(Comp, _extends({}, rest, { | ||
theme: merged, | ||
return React.createElement(Comp, _extends({}, rest, { | ||
theme: _this2._merge(theme, rest.theme), | ||
ref: _reactThemeProviderForwardedRef | ||
})); | ||
if (rest.theme && merged !== rest.theme) { | ||
// If a theme prop was passed, expose it to the children | ||
return React.createElement(ThemeProvider, { | ||
theme: merged | ||
}, element); | ||
} | ||
return element; | ||
}); | ||
@@ -90,0 +79,0 @@ }; |
{ | ||
"name": "@callstack/react-theme-provider", | ||
"version": "2.0.1", | ||
"version": "2.0.2", | ||
"description": "Theme provider for react and react-naitve applications", | ||
@@ -43,2 +43,3 @@ "main": "./lib/index.js", | ||
"@callstack/eslint-config": "^3.0.2", | ||
"@types/hoist-non-react-statics": "^3.3.1", | ||
"@types/react": "^16.8.8", | ||
@@ -45,0 +46,0 @@ "eslint": "^5.15.1", |
@@ -5,2 +5,3 @@ // Type definitions for @callstack/react-theme-provider 1.0.2 | ||
import * as React from 'react'; | ||
import hoistNonReactStatics = require('hoist-non-react-statics'); | ||
@@ -12,7 +13,8 @@ type $Without<T, K> = Pick<T, Exclude<keyof T, K>>; | ||
ThemeProvider: React.ComponentType<{ theme?: Theme }>; | ||
withTheme: <Props extends { theme: Theme }>( | ||
Comp: React.ComponentType<Props> | ||
withTheme: <Props extends { theme: Theme }, C>( | ||
WrappedComponent: React.ComponentType<Props> & C | ||
) => React.ComponentType< | ||
$Without<Props, 'theme'> & { theme?: $DeepPartial<Theme> } | ||
>; | ||
> & | ||
hoistNonReactStatics.NonReactStatics<typeof WrappedComponent>; | ||
useTheme(overrides?: $DeepPartial<Theme>): Theme; | ||
@@ -19,0 +21,0 @@ }; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
31160
17
200