koordinates / xstate-tree

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

fix(routing): notify about double routing roots #47

Closed UberMouse closed 1 year ago

UberMouse commented 1 year ago

Having two routing roots on the page at once causes problems, as they are both listening to the same routing events

If they have the same routes supplied it's probably ok, just double broadcast messages.

But if they have different routes then one will broadcast a 404 event, and one will not.

Better not to do it at all. So that will now throw an error in dev and log an error message in prod to enable it to be caught.

Had to add the node types to enable using process

UberMouse commented 1 year ago

Ok forgot one check, this shouldn't happen if it's not a routing root. And apparently the test doesn't actually do anything so I need to figure out a better way to determine the render threw an error :thinking:

github-actions[bot] commented 1 year ago

:tada: This PR is included in version 4.3.0-beta.3 :tada:

The release is available on:

Your semantic-release bot :package::rocket: