简体   繁体   中英

list of InPortal's

I'm trying to use react-reverse-portal for an infinite scroller (to cache expensive components). So far so good.

For conciseness, I generate a list of InPortals to activate them, and keep them up to date - without a div wrapper for each.

  1. Is this risking a memory leak, or does react clean out InPortals not included in a list iteration?

  2. Is there a way to include the key argument ( ReactDOM.createPortal(children, container, key ) using InPortal? I'm presuming this would help react maintain a clean list of active portals

没关系,这只是向 InPortal 组件添加一个key属性的问题。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM