prevwong / reka.js

💎 State management system to build any no-code editor
https://reka.js.org/
MIT License
611 stars 42 forks source link

Enforce "accepts" property in named slots #163

Open prevwong opened 3 months ago

prevwong commented 3 months ago

Enforce slot accepts directive to only allow component of certain types to be used as slot children:

component Card() => (
  <div>
     <slot name="top" accepts={Button} />
 </div>
)

This will allow us to achieve similar drag and drop rules that exists in Craft currently