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

Modifying or adding extensions doesn't work until re-render #419

Open
batmilkyway opened this issue Nov 20, 2022 · 0 comments
Open

Modifying or adding extensions doesn't work until re-render #419

batmilkyway opened this issue Nov 20, 2022 · 0 comments

Comments

@batmilkyway
Copy link

batmilkyway commented Nov 20, 2022

Here's a small example to reproduce https://codesandbox.io/s/peaceful-waterfall-mtumc5?file=/src/App.js

I expect def to be colorized due to the python extension. Nothing happens though until one of two things:

  1. Clicking the button
  2. Some sort of action that causes a re-render, for example changing the text of the button in the code, and then the hot code reloader causes a re-render.

At least that's what I think is happening. Not sure if I'm doing something wrong, or unexpected, or if there's a work around.

edit: The reason I'm asking is because currently my code is structured such that I add extensions inside of a class being initialized (via useState) inside the App component, but outside of the CodeMirror component. I can move all of that outside of the class such that it can be passed into the extensions prop, but I'm wondering if this is possible as this code organization fits my own mental model better.

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

1 participant