1. 首页
  2. 数据库
  3. 其它
  4. react teleportation:将组件传送到前台 源码

react teleportation:将组件传送到前台 源码

上传者: 2021-04-04 14:59:43上传 ZIP文件 152.43KB 热度 6次
React运输 为什么 ? 遵循门户原则, 在DOM中创建新树以在前景中显示某些组件。 通过一些z-index怪异技巧避免头痛 :face_screaming_in_fear: 并且即使您从树中深处的组件运行模态,也可以全屏显示您的传送组件。 用法 import React from 'react' import Teleport , { Lightbox } from 'react-teleportation' const Home = ( ) => { const openLightbox = ( ) => Teleport . init ( < Lightbox xss=removed> ) return ( < a xss=removed> Open Lightbox < / a > ) } export default Home 可用组件 灯箱 < Li
下载地址
用户评论