Skip to content

Commit

Permalink
fix(core): fix another $$typeof issue (#4113)
Browse files Browse the repository at this point in the history
  • Loading branch information
imhoffd committed Jan 25, 2021
1 parent f190e2d commit 4cbae41
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions core/src/runtime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,18 +80,18 @@ export const createCapacitor = (win: WindowCapacitor): CapacitorInstance => {
{},
{
get(_, prop) {
// https://github.com/facebook/react/issues/20030
if (prop === '$$typeof') {
return undefined;
}

const func = Reflect.get(nativePluginImpl, prop);
if (typeof func === 'function') {
// call the plugin method, Plugin.method(args)
// platform implementation already ready to go
return func;
}

// https://github.com/facebook/react/issues/20030
if (prop === '$$typeof') {
return undefined;
}

throw new CapacitorException(
`"${pluginName}.${
prop as any
Expand All @@ -114,6 +114,11 @@ export const createCapacitor = (win: WindowCapacitor): CapacitorInstance => {
{},
{
get(_, prop) {
// https://github.com/facebook/react/issues/20030
if (prop === '$$typeof') {
return undefined;
}

// proxy getter for any call on this plugin object
const platform = getPlatform();
const pltImplementation = impls[platform];
Expand Down

0 comments on commit 4cbae41

Please sign in to comment.