Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: reenter in sibling states #4818

Open
Jfsslemos opened this issue Mar 27, 2024 · 3 comments
Open

Bug: reenter in sibling states #4818

Jfsslemos opened this issue Mar 27, 2024 · 3 comments
Labels

Comments

@Jfsslemos
Copy link

XState version

XState version 5

Description

Reenter attribute doesn't work on sibiling states

Expected result

[...]
states:{
state1:{
entry: console.log(''state1")
on:{
'':{target: 'state2'
reenter: true},
},
},
state2:{
entry: console.log(''state2")
on:{
'
':{target: 'state1'
reenter: true},
},
},
}
[...]

output: state1
state2
state1
state2
state1
state2
[...]

Actual result

output: state1
state2
and stops here, doesn't reenter in states that are not parent-child

Reproduction

i dont really know how to make those options of reproduction

Additional context

No response

@Jfsslemos Jfsslemos added the bug label Mar 27, 2024
@davidkpiano
Copy link
Member

Reentry does not apply here since you are not reentering the same (or ancestor) state.

@Jfsslemos
Copy link
Author

But how could I achieve this functionality? Just to be clear, i have no parente-child state, only sibiling states. And I want transition many times to the same state during the execution in a way that every time the state execute it's entry function

@Jfsslemos
Copy link
Author

Reentry does not apply here since you are not reentering the same (or ancestor) state.

But how could I achieve this functionality? Just to be clear, i have no parente-child state, only sibiling states. And I want transition many times to the same state during the execution in a way that every time the state execute it's entry function

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants