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

fix: Update CodeMirror View when autoReload changed #1059

Merged
merged 1 commit into from
Jan 17, 2024

Conversation

mehmetpekcan
Copy link
Contributor

What kind of change does this pull request introduce?

Updates CodeMirror View constructor's useEffect's dependencies to make sure when autoReload option is changed we have re-evaluated onCodeUpdate version.

What is the current behavior?

When we have a custom editors setup just like the examples shown in Doc > Quickstart > Multiple Editors, autoReload update doesn't work out because CodeMirror View doesn't re-evaluate onCodeUpdate so that we can't send the latest value of shouldUpdatePreview.

What is the new behavior?

onCodeUpdate callback will be re-evaluated once autoReload option is changed.

What steps did you take to test this? This is required before we can merge, make sure to test the flow you've updated.

Created a Story to test out everything works as expected.

Checklist

  • Documentation;
  • Storybook (if applicable);
  • Tests;
  • Ready to be merged;

Copy link

codesandbox bot commented Jan 13, 2024

Review or Edit in CodeSandbox

Open the branch in Web EditorVS CodeInsiders

Open Preview

Copy link

vercel bot commented Jan 13, 2024

@mehmetpekcan is attempting to deploy a commit to the CodeSandbox Team on Vercel.

A member of the Team first needs to authorize it.

Copy link

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit d3d619c:

Sandbox Source
Sandpack Configuration
sandpack-run-stale-value Configuration

Copy link
Member

@danilowoz danilowoz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks for fixing it

@danilowoz danilowoz merged commit 782c0c7 into codesandbox:main Jan 17, 2024
1 of 4 checks passed
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

2 participants