Skip to content

Commit 93b65fd

Browse files
Merge pull request #81 from CptLemming/bugfix/inner-ref
Bugfix - Inner ref
2 parents e1846fd + dff97fa commit 93b65fd

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

index.d.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ declare module "@friendsofreactjs/react-css-themr" {
1717
}
1818

1919
export interface ThemeProviderProps {
20-
innerRef?: Function,
2120
theme: TReactCSSThemrTheme
2221
}
2322

@@ -35,6 +34,6 @@ declare module "@friendsofreactjs/react-css-themr" {
3534
identifier: string | number | symbol,
3635
defaultTheme?: {},
3736
options?: IThemrOptions
38-
): <P, S>(component: (new(props: P, context?: any) => React.Component<P, S>) | React.SFC<P>) =>
39-
ThemedComponentClass<P & { mapThemrProps?: TMapThemrProps<P> }, S>;
37+
): <P, S, R>(component: (new(props: P, context?: any) => React.Component<P, S>) | React.SFC<P>) =>
38+
ThemedComponentClass<P & { mapThemrProps?: TMapThemrProps<P>, innerRef?: React.Ref<R> }, S>;
4039
}

lib/components/themr.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ var _default = function _default(componentName, localTheme) {
196196

197197
_defineProperty(Themed, "propTypes", _objectSpread({}, ThemedComponent.propTypes, {
198198
composeTheme: _propTypes["default"].oneOf([COMPOSE_DEEPLY, COMPOSE_SOFTLY, DONT_COMPOSE]),
199-
innerRef: _propTypes["default"].func,
199+
innerRef: _propTypes["default"].oneOfType([_propTypes["default"].func, _propTypes["default"].object]),
200200
theme: _propTypes["default"].object,
201201
themeNamespace: _propTypes["default"].string,
202202
mapThemrProps: _propTypes["default"].func

src/components/themr.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ export default (componentName, localTheme, options = {}) => ThemedComponent => {
7070
COMPOSE_SOFTLY,
7171
DONT_COMPOSE
7272
]),
73-
innerRef: PropTypes.func,
73+
innerRef: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
7474
theme: PropTypes.object,
7575
themeNamespace: PropTypes.string,
7676
mapThemrProps: PropTypes.func

0 commit comments

Comments
 (0)