@tamagui/portal 1.0.1-beta.174 → 1.0.1-beta.176
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/Portal.js.map +2 -2
- package/dist/cjs/Portal.native.js +5 -0
- package/dist/cjs/Portal.native.js.map +2 -2
- package/dist/cjs/PortalProps.js +17 -0
- package/dist/cjs/PortalProps.js.map +7 -0
- package/dist/esm/Portal.js.map +2 -2
- package/dist/esm/Portal.native.js +5 -0
- package/dist/esm/Portal.native.js.map +2 -2
- package/dist/esm/PortalProps.js +1 -0
- package/dist/esm/PortalProps.js.map +7 -0
- package/dist/jsx/Portal.js.map +2 -2
- package/dist/jsx/Portal.native.js +5 -0
- package/dist/jsx/Portal.native.js.map +2 -2
- package/dist/jsx/PortalProps.js +1 -0
- package/dist/jsx/PortalProps.js.map +7 -0
- package/package.json +4 -4
- package/src/Portal.native.tsx +8 -1
- package/src/Portal.tsx +2 -4
- package/src/PortalProps.tsx +6 -0
- package/types/Portal.d.ts +1 -4
- package/types/Portal.native.d.ts +1 -2
- package/types/PortalProps.d.ts +6 -0
package/dist/cjs/Portal.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/Portal.tsx"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable react-hooks/rules-of-hooks */\nimport '@tamagui/polyfill-dev'\n\nimport { isWeb, useIsomorphicLayoutEffect } from '@tamagui/core'\nimport { YStack
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;
|
|
4
|
+
"sourcesContent": ["/* eslint-disable react-hooks/rules-of-hooks */\nimport '@tamagui/polyfill-dev'\n\nimport { isWeb, useIsomorphicLayoutEffect } from '@tamagui/core'\nimport { YStack } from '@tamagui/stacks'\nimport * as React from 'react'\nimport { createPortal } from 'react-dom'\n\nimport { PortalProps } from './PortalProps'\n\nexport const Portal = ({ host = globalThis.document?.body, ...props }: PortalProps) => {\n const contents = (\n <YStack\n pointerEvents=\"box-none\"\n contain=\"strict\"\n fullscreen\n // @ts-expect-error ok on web\n position={isWeb ? 'fixed' : 'absolute'}\n maxWidth={isWeb ? '100vw' : '100%'}\n maxHeight={isWeb ? '100vh' : '100%'}\n {...props}\n />\n )\n\n const [hostElement, setHostElement] = React.useState<any>(null)\n\n useIsomorphicLayoutEffect(() => {\n setHostElement(host)\n }, [host])\n\n if (hostElement) {\n return createPortal(contents, hostElement)\n }\n\n // ssr return null\n return null\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAYI;AAXJ,0BAAO;AAEP,kBAAiD;AACjD,oBAAuB;AACvB,YAAuB;AACvB,uBAA6B;AAItB,MAAM,SAAS,CAAC,EAAE,QAAO,yBAAW,aAAX,mBAAqB,YAAS,MAAM,MAAmB;AACrF,QAAM,WACJ,4CAAC;AAAA,IACC,eAAc;AAAA,IACd,SAAQ;AAAA,IACR,YAAU;AAAA,IAEV,UAAU,oBAAQ,UAAU;AAAA,IAC5B,UAAU,oBAAQ,UAAU;AAAA,IAC5B,WAAW,oBAAQ,UAAU;AAAA,IAC5B,GAAG;AAAA,GACN;AAGF,QAAM,CAAC,aAAa,cAAc,IAAI,MAAM,SAAc,IAAI;AAE9D,6CAA0B,MAAM;AAC9B,mBAAe,IAAI;AAAA,EACrB,GAAG,CAAC,IAAI,CAAC;AAET,MAAI,aAAa;AACf,eAAO,+BAAa,UAAU,WAAW;AAAA,EAC3C;AAGA,SAAO;AACT;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -45,6 +45,11 @@ const Portal = (props) => {
|
|
|
45
45
|
if (rootTag) {
|
|
46
46
|
return (0, import_ReactNative.createPortal)(contents, rootTag);
|
|
47
47
|
}
|
|
48
|
+
if (process.env.NODE_ENV === "development") {
|
|
49
|
+
console.warn(
|
|
50
|
+
`Missing rootTag, this is a bug - you may need a different React Native version, or to avoid using "modal" on native.`
|
|
51
|
+
);
|
|
52
|
+
}
|
|
48
53
|
return null;
|
|
49
54
|
};
|
|
50
55
|
// Annotate the CommonJS export names for ESM import in node:
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/Portal.native.tsx"],
|
|
4
|
-
"sourcesContent": ["import { YStack, YStackProps } from '@tamagui/stacks'\nimport * as React from 'react'\n// @ts-ignore\nimport { RootTagContext } from 'react-native'\nimport { createPortal } from 'react-native/Libraries/Renderer/shims/ReactNative'\n\
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAYI;AAZJ,oBAAoC;AACpC,YAAuB;AAEvB,0BAA+B;AAC/B,yBAA6B;AAItB,MAAM,SAAS,CAAC,UAAuB;AAC5C,QAAM,UAAU,MAAM,WAAW,kCAAc;AAE/C,QAAM,WACJ,4CAAC;AAAA,IACC,eAAc;AAAA,IACd,YAAU;AAAA,IACV,UAAS;AAAA,IACT,UAAS;AAAA,IACT,QAAQ;AAAA,IACP,GAAG;AAAA,GACN;AAGF,MAAI,SAAS;AACX,eAAO,iCAAa,UAAU,OAAO;AAAA,EACvC;AAEA,SAAO;AACT;",
|
|
4
|
+
"sourcesContent": ["import { YStack, YStackProps } from '@tamagui/stacks'\nimport * as React from 'react'\n// @ts-ignore\nimport { RootTagContext } from 'react-native'\nimport { createPortal } from 'react-native/Libraries/Renderer/shims/ReactNative'\n\nimport { PortalProps } from './PortalProps'\n\nexport const Portal = (props: PortalProps) => {\n const rootTag = React.useContext(RootTagContext)\n\n const contents = (\n <YStack\n pointerEvents=\"box-none\"\n fullscreen\n position=\"absolute\"\n maxWidth=\"100%\"\n zIndex={100000}\n {...props}\n />\n )\n\n if (rootTag) {\n return createPortal(contents, rootTag)\n }\n\n if (process.env.NODE_ENV === 'development') {\n // eslint-disable-next-line no-console\n console.warn(\n `Missing rootTag, this is a bug - you may need a different React Native version, or to avoid using \"modal\" on native.`\n )\n }\n\n return null\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAYI;AAZJ,oBAAoC;AACpC,YAAuB;AAEvB,0BAA+B;AAC/B,yBAA6B;AAItB,MAAM,SAAS,CAAC,UAAuB;AAC5C,QAAM,UAAU,MAAM,WAAW,kCAAc;AAE/C,QAAM,WACJ,4CAAC;AAAA,IACC,eAAc;AAAA,IACd,YAAU;AAAA,IACV,UAAS;AAAA,IACT,UAAS;AAAA,IACT,QAAQ;AAAA,IACP,GAAG;AAAA,GACN;AAGF,MAAI,SAAS;AACX,eAAO,iCAAa,UAAU,OAAO;AAAA,EACvC;AAEA,MAAI,QAAQ,IAAI,aAAa,eAAe;AAE1C,YAAQ;AAAA,MACN;AAAA,IACF;AAAA,EACF;AAEA,SAAO;AACT;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __copyProps = (to, from, except, desc) => {
|
|
7
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
+
for (let key of __getOwnPropNames(from))
|
|
9
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
+
}
|
|
12
|
+
return to;
|
|
13
|
+
};
|
|
14
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
+
var PortalProps_exports = {};
|
|
16
|
+
module.exports = __toCommonJS(PortalProps_exports);
|
|
17
|
+
//# sourceMappingURL=PortalProps.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/PortalProps.tsx"],
|
|
4
|
+
"sourcesContent": ["import { YStackProps } from '@tamagui/stacks'\n\nexport type PortalProps = YStackProps & {\n host?: any // element\n inactive?: boolean\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;AAAA;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/dist/esm/Portal.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/Portal.tsx"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable react-hooks/rules-of-hooks */\nimport '@tamagui/polyfill-dev'\n\nimport { isWeb, useIsomorphicLayoutEffect } from '@tamagui/core'\nimport { YStack
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["/* eslint-disable react-hooks/rules-of-hooks */\nimport '@tamagui/polyfill-dev'\n\nimport { isWeb, useIsomorphicLayoutEffect } from '@tamagui/core'\nimport { YStack } from '@tamagui/stacks'\nimport * as React from 'react'\nimport { createPortal } from 'react-dom'\n\nimport { PortalProps } from './PortalProps'\n\nexport const Portal = ({ host = globalThis.document?.body, ...props }: PortalProps) => {\n const contents = (\n <YStack\n pointerEvents=\"box-none\"\n contain=\"strict\"\n fullscreen\n // @ts-expect-error ok on web\n position={isWeb ? 'fixed' : 'absolute'}\n maxWidth={isWeb ? '100vw' : '100%'}\n maxHeight={isWeb ? '100vh' : '100%'}\n {...props}\n />\n )\n\n const [hostElement, setHostElement] = React.useState<any>(null)\n\n useIsomorphicLayoutEffect(() => {\n setHostElement(host)\n }, [host])\n\n if (hostElement) {\n return createPortal(contents, hostElement)\n }\n\n // ssr return null\n return null\n}\n"],
|
|
5
|
+
"mappings": "AAYI;AAXJ,OAAO;AAEP,SAAS,OAAO,iCAAiC;AACjD,SAAS,cAAc;AACvB,YAAY,WAAW;AACvB,SAAS,oBAAoB;AAItB,MAAM,SAAS,CAAC,EAAE,QAAO,yBAAW,aAAX,mBAAqB,YAAS,MAAM,MAAmB;AACrF,QAAM,WACJ,oBAAC;AAAA,IACC,eAAc;AAAA,IACd,SAAQ;AAAA,IACR,YAAU;AAAA,IAEV,UAAU,QAAQ,UAAU;AAAA,IAC5B,UAAU,QAAQ,UAAU;AAAA,IAC5B,WAAW,QAAQ,UAAU;AAAA,IAC5B,GAAG;AAAA,GACN;AAGF,QAAM,CAAC,aAAa,cAAc,IAAI,MAAM,SAAc,IAAI;AAE9D,4BAA0B,MAAM;AAC9B,mBAAe,IAAI;AAAA,EACrB,GAAG,CAAC,IAAI,CAAC;AAET,MAAI,aAAa;AACf,WAAO,aAAa,UAAU,WAAW;AAAA,EAC3C;AAGA,SAAO;AACT;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -16,6 +16,11 @@ const Portal = (props) => {
|
|
|
16
16
|
if (rootTag) {
|
|
17
17
|
return createPortal(contents, rootTag);
|
|
18
18
|
}
|
|
19
|
+
if (process.env.NODE_ENV === "development") {
|
|
20
|
+
console.warn(
|
|
21
|
+
`Missing rootTag, this is a bug - you may need a different React Native version, or to avoid using "modal" on native.`
|
|
22
|
+
);
|
|
23
|
+
}
|
|
19
24
|
return null;
|
|
20
25
|
};
|
|
21
26
|
export {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/Portal.native.tsx"],
|
|
4
|
-
"sourcesContent": ["import { YStack, YStackProps } from '@tamagui/stacks'\nimport * as React from 'react'\n// @ts-ignore\nimport { RootTagContext } from 'react-native'\nimport { createPortal } from 'react-native/Libraries/Renderer/shims/ReactNative'\n\
|
|
5
|
-
"mappings": "AAYI;AAZJ,SAAS,cAA2B;AACpC,YAAY,WAAW;AAEvB,SAAS,sBAAsB;AAC/B,SAAS,oBAAoB;AAItB,MAAM,SAAS,CAAC,UAAuB;AAC5C,QAAM,UAAU,MAAM,WAAW,cAAc;AAE/C,QAAM,WACJ,oBAAC;AAAA,IACC,eAAc;AAAA,IACd,YAAU;AAAA,IACV,UAAS;AAAA,IACT,UAAS;AAAA,IACT,QAAQ;AAAA,IACP,GAAG;AAAA,GACN;AAGF,MAAI,SAAS;AACX,WAAO,aAAa,UAAU,OAAO;AAAA,EACvC;AAEA,SAAO;AACT;",
|
|
4
|
+
"sourcesContent": ["import { YStack, YStackProps } from '@tamagui/stacks'\nimport * as React from 'react'\n// @ts-ignore\nimport { RootTagContext } from 'react-native'\nimport { createPortal } from 'react-native/Libraries/Renderer/shims/ReactNative'\n\nimport { PortalProps } from './PortalProps'\n\nexport const Portal = (props: PortalProps) => {\n const rootTag = React.useContext(RootTagContext)\n\n const contents = (\n <YStack\n pointerEvents=\"box-none\"\n fullscreen\n position=\"absolute\"\n maxWidth=\"100%\"\n zIndex={100000}\n {...props}\n />\n )\n\n if (rootTag) {\n return createPortal(contents, rootTag)\n }\n\n if (process.env.NODE_ENV === 'development') {\n // eslint-disable-next-line no-console\n console.warn(\n `Missing rootTag, this is a bug - you may need a different React Native version, or to avoid using \"modal\" on native.`\n )\n }\n\n return null\n}\n"],
|
|
5
|
+
"mappings": "AAYI;AAZJ,SAAS,cAA2B;AACpC,YAAY,WAAW;AAEvB,SAAS,sBAAsB;AAC/B,SAAS,oBAAoB;AAItB,MAAM,SAAS,CAAC,UAAuB;AAC5C,QAAM,UAAU,MAAM,WAAW,cAAc;AAE/C,QAAM,WACJ,oBAAC;AAAA,IACC,eAAc;AAAA,IACd,YAAU;AAAA,IACV,UAAS;AAAA,IACT,UAAS;AAAA,IACT,QAAQ;AAAA,IACP,GAAG;AAAA,GACN;AAGF,MAAI,SAAS;AACX,WAAO,aAAa,UAAU,OAAO;AAAA,EACvC;AAEA,MAAI,QAAQ,IAAI,aAAa,eAAe;AAE1C,YAAQ;AAAA,MACN;AAAA,IACF;AAAA,EACF;AAEA,SAAO;AACT;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=PortalProps.js.map
|
package/dist/jsx/Portal.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/Portal.tsx"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable react-hooks/rules-of-hooks */\nimport '@tamagui/polyfill-dev'\n\nimport { isWeb, useIsomorphicLayoutEffect } from '@tamagui/core'\nimport { YStack
|
|
5
|
-
"mappings": "AACA,OAAO;AAEP,SAAS,OAAO,iCAAiC;AACjD,SAAS,
|
|
4
|
+
"sourcesContent": ["/* eslint-disable react-hooks/rules-of-hooks */\nimport '@tamagui/polyfill-dev'\n\nimport { isWeb, useIsomorphicLayoutEffect } from '@tamagui/core'\nimport { YStack } from '@tamagui/stacks'\nimport * as React from 'react'\nimport { createPortal } from 'react-dom'\n\nimport { PortalProps } from './PortalProps'\n\nexport const Portal = ({ host = globalThis.document?.body, ...props }: PortalProps) => {\n const contents = (\n <YStack\n pointerEvents=\"box-none\"\n contain=\"strict\"\n fullscreen\n // @ts-expect-error ok on web\n position={isWeb ? 'fixed' : 'absolute'}\n maxWidth={isWeb ? '100vw' : '100%'}\n maxHeight={isWeb ? '100vh' : '100%'}\n {...props}\n />\n )\n\n const [hostElement, setHostElement] = React.useState<any>(null)\n\n useIsomorphicLayoutEffect(() => {\n setHostElement(host)\n }, [host])\n\n if (hostElement) {\n return createPortal(contents, hostElement)\n }\n\n // ssr return null\n return null\n}\n"],
|
|
5
|
+
"mappings": "AACA,OAAO;AAEP,SAAS,OAAO,iCAAiC;AACjD,SAAS,cAAc;AACvB,YAAY,WAAW;AACvB,SAAS,oBAAoB;AAItB,MAAM,SAAS,CAAC,EAAE,OAAO,WAAW,UAAU,SAAS,MAAM,MAAmB;AACrF,QAAM,WACJ,CAAC,OACC,cAAc,WACd,QAAQ,SACR,WAEA,UAAU,QAAQ,UAAU,YAC5B,UAAU,QAAQ,UAAU,QAC5B,WAAW,QAAQ,UAAU,YACzB,OACN;AAGF,QAAM,CAAC,aAAa,cAAc,IAAI,MAAM,SAAc,IAAI;AAE9D,4BAA0B,MAAM;AAC9B,mBAAe,IAAI;AAAA,EACrB,GAAG,CAAC,IAAI,CAAC;AAET,MAAI,aAAa;AACf,WAAO,aAAa,UAAU,WAAW;AAAA,EAC3C;AAGA,SAAO;AACT;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -8,6 +8,11 @@ const Portal = (props) => {
|
|
|
8
8
|
if (rootTag) {
|
|
9
9
|
return createPortal(contents, rootTag);
|
|
10
10
|
}
|
|
11
|
+
if (process.env.NODE_ENV === "development") {
|
|
12
|
+
console.warn(
|
|
13
|
+
`Missing rootTag, this is a bug - you may need a different React Native version, or to avoid using "modal" on native.`
|
|
14
|
+
);
|
|
15
|
+
}
|
|
11
16
|
return null;
|
|
12
17
|
};
|
|
13
18
|
export {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/Portal.native.tsx"],
|
|
4
|
-
"sourcesContent": ["import { YStack, YStackProps } from '@tamagui/stacks'\nimport * as React from 'react'\n// @ts-ignore\nimport { RootTagContext } from 'react-native'\nimport { createPortal } from 'react-native/Libraries/Renderer/shims/ReactNative'\n\
|
|
5
|
-
"mappings": "AAAA,SAAS,cAA2B;AACpC,YAAY,WAAW;AAEvB,SAAS,sBAAsB;AAC/B,SAAS,oBAAoB;AAItB,MAAM,SAAS,CAAC,UAAuB;AAC5C,QAAM,UAAU,MAAM,WAAW,cAAc;AAE/C,QAAM,WACJ,CAAC,OACC,cAAc,WACd,WACA,SAAS,WACT,SAAS,OACT,QAAQ,SACJ,OACN;AAGF,MAAI,SAAS;AACX,WAAO,aAAa,UAAU,OAAO;AAAA,EACvC;AAEA,SAAO;AACT;",
|
|
4
|
+
"sourcesContent": ["import { YStack, YStackProps } from '@tamagui/stacks'\nimport * as React from 'react'\n// @ts-ignore\nimport { RootTagContext } from 'react-native'\nimport { createPortal } from 'react-native/Libraries/Renderer/shims/ReactNative'\n\nimport { PortalProps } from './PortalProps'\n\nexport const Portal = (props: PortalProps) => {\n const rootTag = React.useContext(RootTagContext)\n\n const contents = (\n <YStack\n pointerEvents=\"box-none\"\n fullscreen\n position=\"absolute\"\n maxWidth=\"100%\"\n zIndex={100000}\n {...props}\n />\n )\n\n if (rootTag) {\n return createPortal(contents, rootTag)\n }\n\n if (process.env.NODE_ENV === 'development') {\n // eslint-disable-next-line no-console\n console.warn(\n `Missing rootTag, this is a bug - you may need a different React Native version, or to avoid using \"modal\" on native.`\n )\n }\n\n return null\n}\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,cAA2B;AACpC,YAAY,WAAW;AAEvB,SAAS,sBAAsB;AAC/B,SAAS,oBAAoB;AAItB,MAAM,SAAS,CAAC,UAAuB;AAC5C,QAAM,UAAU,MAAM,WAAW,cAAc;AAE/C,QAAM,WACJ,CAAC,OACC,cAAc,WACd,WACA,SAAS,WACT,SAAS,OACT,QAAQ,SACJ,OACN;AAGF,MAAI,SAAS;AACX,WAAO,aAAa,UAAU,OAAO;AAAA,EACvC;AAEA,MAAI,QAAQ,IAAI,aAAa,eAAe;AAE1C,YAAQ;AAAA,MACN;AAAA,IACF;AAAA,EACF;AAEA,SAAO;AACT;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=PortalProps.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tamagui/portal",
|
|
3
|
-
"version": "1.0.1-beta.
|
|
3
|
+
"version": "1.0.1-beta.176",
|
|
4
4
|
"source": "src/index.ts",
|
|
5
5
|
"types": "./types/index.d.ts",
|
|
6
6
|
"main": "dist/cjs",
|
|
@@ -20,8 +20,8 @@
|
|
|
20
20
|
"clean:build": "tamagui-build clean:build"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@tamagui/core": "^1.0.1-beta.
|
|
24
|
-
"@tamagui/stacks": "^1.0.1-beta.
|
|
23
|
+
"@tamagui/core": "^1.0.1-beta.176",
|
|
24
|
+
"@tamagui/stacks": "^1.0.1-beta.176"
|
|
25
25
|
},
|
|
26
26
|
"peerDependencies": {
|
|
27
27
|
"react": "*",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"react-native": "*"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"@tamagui/build": "^1.0.1-beta.
|
|
32
|
+
"@tamagui/build": "^1.0.1-beta.176",
|
|
33
33
|
"@types/react-native": "^0.69.2",
|
|
34
34
|
"react": "*",
|
|
35
35
|
"react-dom": "*",
|
package/src/Portal.native.tsx
CHANGED
|
@@ -4,7 +4,7 @@ import * as React from 'react'
|
|
|
4
4
|
import { RootTagContext } from 'react-native'
|
|
5
5
|
import { createPortal } from 'react-native/Libraries/Renderer/shims/ReactNative'
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
import { PortalProps } from './PortalProps'
|
|
8
8
|
|
|
9
9
|
export const Portal = (props: PortalProps) => {
|
|
10
10
|
const rootTag = React.useContext(RootTagContext)
|
|
@@ -24,5 +24,12 @@ export const Portal = (props: PortalProps) => {
|
|
|
24
24
|
return createPortal(contents, rootTag)
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
+
if (process.env.NODE_ENV === 'development') {
|
|
28
|
+
// eslint-disable-next-line no-console
|
|
29
|
+
console.warn(
|
|
30
|
+
`Missing rootTag, this is a bug - you may need a different React Native version, or to avoid using "modal" on native.`
|
|
31
|
+
)
|
|
32
|
+
}
|
|
33
|
+
|
|
27
34
|
return null
|
|
28
35
|
}
|
package/src/Portal.tsx
CHANGED
|
@@ -2,13 +2,11 @@
|
|
|
2
2
|
import '@tamagui/polyfill-dev'
|
|
3
3
|
|
|
4
4
|
import { isWeb, useIsomorphicLayoutEffect } from '@tamagui/core'
|
|
5
|
-
import { YStack
|
|
5
|
+
import { YStack } from '@tamagui/stacks'
|
|
6
6
|
import * as React from 'react'
|
|
7
7
|
import { createPortal } from 'react-dom'
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
host?: any // element
|
|
11
|
-
}
|
|
9
|
+
import { PortalProps } from './PortalProps'
|
|
12
10
|
|
|
13
11
|
export const Portal = ({ host = globalThis.document?.body, ...props }: PortalProps) => {
|
|
14
12
|
const contents = (
|
package/types/Portal.d.ts
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
import '@tamagui/polyfill-dev';
|
|
2
|
-
import { YStackProps } from '@tamagui/stacks';
|
|
3
2
|
import * as React from 'react';
|
|
4
|
-
|
|
5
|
-
host?: any;
|
|
6
|
-
};
|
|
3
|
+
import { PortalProps } from './PortalProps';
|
|
7
4
|
export declare const Portal: ({ host, ...props }: PortalProps) => React.ReactPortal | null;
|
|
8
5
|
//# sourceMappingURL=Portal.d.ts.map
|
package/types/Portal.native.d.ts
CHANGED