promise-portal 1.0.2 → 1.0.3
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/README.md +14 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -155,6 +155,20 @@ const onClick = async () => {
|
|
|
155
155
|
const output = await portal() // only allow empty parameter
|
|
156
156
|
```
|
|
157
157
|
|
|
158
|
+
you can set a config to definePortal
|
|
159
|
+
|
|
160
|
+
```ts
|
|
161
|
+
definePortal(Comp, {
|
|
162
|
+
// set a time gap before portal unmount,
|
|
163
|
+
// in general, it to wait for animation effect
|
|
164
|
+
unmountDelay: 1000,
|
|
165
|
+
// set promise-portal instance explicitly to render this portal
|
|
166
|
+
// not use the active instance internally
|
|
167
|
+
// of course, you can use `setActiveInstance` to set active instance
|
|
168
|
+
instance: promisePortalInstance,
|
|
169
|
+
})
|
|
170
|
+
```
|
|
171
|
+
|
|
158
172
|
## Link
|
|
159
173
|
|
|
160
174
|
[@filez/portal](https://github.com/lenovo-filez/portal)
|