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

Prevent unnecessary TeX block rerendering #10

Merged
merged 1 commit into from
Nov 26, 2017
Merged

Prevent unnecessary TeX block rerendering #10

merged 1 commit into from
Nov 26, 2017

Conversation

pmeinhardt
Copy link
Contributor

@pmeinhardt pmeinhardt commented Nov 23, 2017

Before, a new decorated TeXBlock component was created on each call to the blockRenderFn which caused existing TeXBlock components to be unmounted and new ones mounted. That meant, that the componentWillReceiveProps optimization in the KaTeXOutput component wasn't effective.

Since the props used for decorating do not change over time, we can instead only create the decorated TexBlock component once, when the plugin is configured.

Before, we saw quite a bit of flickering when typing into an editor which was quite tiring.

Now it's completely smooth 😃

cc @tessi

Before, a new decorated `TeXBlock` component was created on each call to
the `blockRenderFn` which caused existing `TeXBlock` components to be
unmounted an new ones mounted.
@letranloc letranloc merged commit 11b1466 into letranloc:master Nov 26, 2017
@pmeinhardt
Copy link
Contributor Author

Awesome @letranloc, thanks a lot for publishing this plugin in the first place and also for pushing another release this quickly. Cheers 🙂

@letranloc
Copy link
Owner

All PRs are welcome. Thanks! @pmeinhardt

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.

2 participants