mirror of
https://github.com/smartxworks/sunmao-ui.git
synced 2024-11-27 08:39:59 +08:00
ef2669992f
The slot receiver is a magic hole of sunmao's runtime. In sunmao, we support pass props and fallback elements to a slot. But if we pass them as React component's props, it will cause re-render since most of them could not use a shallow equal checker. Also, in sunmao's runtime, we are not using a traditional React render mechanism. Instead, we keep most of the components not be rendered and only subscribe to related state updates. To continue with our design, we need a way to render slot's fallback elements without passing the elements as props. This is where the slot receiver comes. It contains a map and an event emitter, when a slot need render, it will attach the fallback elements to the map and send a signal via the emitter. When the Receiver component receive a signal, it will force render the fallback elements. related: #388 |
||
---|---|---|
.. | ||
arco-lib | ||
chakra-ui-lib | ||
core | ||
editor | ||
editor-sdk | ||
runtime | ||
shared | ||
vite-plugin-fs | ||
vite-plugins |