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

Ensuring example re-renders always work #2148

Closed
wants to merge 1 commit into from

Conversation

stevematney
Copy link

@stevematney stevematney commented Jul 25, 2023

Because the mountNode never changes in the previous version of the code, this.callbackRef would not get called after an error was thrown. After a second re-render with new code, the Example would simply be blank on the screen (not rendering either an Example or an error message).

return (
<>
<div data-testid="mountNode" ref={this.callbackRef} />
{error && <PlaygroundError message={error} />}
</>
);

This code ensures that we always get an Example re-render when new code is present.

@stevematney
Copy link
Author

Resolved by #2158

@stevematney stevematney deleted the fix-preview branch March 25, 2024 22:46
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

Successfully merging this pull request may close these issues.

None yet

1 participant