Skip to content
This repository was archived by the owner on May 15, 2019. It is now read-only.
This repository was archived by the owner on May 15, 2019. It is now read-only.

Issues with TeX component always re-rendering #65

@jaltekruse

Description

@jaltekruse

Hello Khan Team!

I am trying to use the TeX component to render some expressions in my react application. I am experiencing some performance issues, as I am trying to render many expressions on a single page. In this particular case, one time rendering cost isn't too concerning, and I can mitigate some of the time with pagination. I still want to expose several hundred expressions in an individual page of the app.

The problem I am seeing is that the TeX component always re-renders even though the PureRenderMixin is included. Even adding a shouldComponentUpdate method to the component that always returns false, doesn't seem to stop the re-rendering every time any part of the tree is rendered.

I am trying to understand the way that mathjax and katex both manage their rendering lifecycles relative to react. Any help you can provide pointing me at the code I could try modifying to reduce the re-rendering would be appreciated. Happy to contribute back any fixes I am able to make.

I have made a short video showing the react browser plugin tracing the extra rendering in the perseus demo instance.

You can see in the video that the plain text sections of the excercise are not re-rendering. https://www.youtube.com/watch?v=oyZBhp7HVg8&feature=youtu.be

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions