koordinates / xstate-tree

Build UIs with Actors using xstate and React
MIT License
85 stars 6 forks source link

Readme example leaves out most important part: slots #28

Closed redbar0n closed 1 year ago

redbar0n commented 1 year ago

Readme says slots is the defining feature of xstate-tree:

Actors views are composed together via "slots", which can be rendered in the view to provide child actors a place to render their views in the parent's view.

But it leaves it out of the example, so it's hard to see how slots would look and feel when using xstate-tree to its full extent:

// If this tree had more than a single machine the slots to render child machines into would be defined here
const slots = [];
redbar0n commented 1 year ago

The codesandbox example still only has one single child slot. It would be helpful if it had at least 2 or 3, to get an idea of how it scales.

redbar0n commented 1 year ago

In the codesandbox: The slots are also passed into the view, but they don’t seem to be used there..

UberMouse commented 1 year ago

The slot is used here in the view https://codesandbox.io/s/xstate-tree-b0el6e-forked-4i6txh?file=/src/index.tsx:3304-3328

Feel free to expand the example with more slots :) there is no real difference between 1 and 3 slots except you have 3 slots defined and 3 slots rendered in the view.

github-actions[bot] commented 1 year ago

:tada: This issue has been resolved in version 3.0.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: