Skip to content

Commit a40a191

Browse files
fix(overmind-react): fix hook in production
1 parent fedfbae commit a40a191

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
@@ -40,7 +40,9 @@ export const createHook = <A extends Overmind<Configuration>>(overmind: A) => {
4040
ReactCurrentOwner,
4141
} = __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED
4242
const useCurrentComponent = () => {
43-
return ReactCurrentOwner.current.elementType
43+
return ReactCurrentOwner.current
44+
? ReactCurrentOwner.current.elementType
45+
: {}
4446
}
4547

4648
return () => {

0 commit comments

Comments
 (0)