Skip to content

Commit eceffcc

Browse files
fix(overmind-react): fix bug pointing to internal react stuff
1 parent 34675d4 commit eceffcc

File tree

1 file changed

+3
-1
lines changed
  • packages/node_modules/overmind-react/src

1 file changed

+3
-1
lines changed

packages/node_modules/overmind-react/src/index.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,9 @@ export const createHook = <A extends Overmind<Configuration>>(overmind: A) => {
4141
ReactCurrentOwner,
4242
} = __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED
4343
const useCurrentComponent = () => {
44-
return ReactCurrentOwner.current
44+
return ReactCurrentOwner &&
45+
ReactCurrentOwner.current &&
46+
ReactCurrentOwner.current.elementType
4547
? ReactCurrentOwner.current.elementType
4648
: {}
4749
}

0 commit comments

Comments
 (0)