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.
Is this risking a memory leak, or does react clean out InPortals not included in a list iteration?
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.