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

React.Strict breaks the inspector #44

Open
diamond-darrell opened this issue Nov 4, 2024 · 2 comments
Open

React.Strict breaks the inspector #44

diamond-darrell opened this issue Nov 4, 2024 · 2 comments

Comments

@diamond-darrell
Copy link

Hello there,
I've noticed an issue with the inspector when React.Strict mode is enabled.
Basically, it gets stuck on actor execution after rerendering the component that provided the machine. The machine's runtime execution seems fine since we're reaching the idle state, but it makes the inspector unusable afterward. You can see it's working if the strict mode is disabled.

CodeSandbox

https://codesandbox.io/p/sandbox/stately-inspect-iframe-repro-forked-hwv7ch

@davidkpiano
Copy link
Member

One small note: createBrowserInspector() is meant to be called outside of components; that may be a potential source of the problem. Can you try something like this instead?

const inspector = createBrowserInspector();

function Component() {
  // the rest of your code
}

@diamond-darrell
Copy link
Author

@davidkpiano yes, I've updated the codesandbox example. The issue still happens

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

No branches or pull requests

2 participants