react-transcript-editor
react-transcript-editor copied to clipboard
Adding test to timed text editor
Is your Pull Request request related to another issue in this repository ?
Not from this issue, but DPE has a dependency on react-transcript-editor and we want to start adding tests to it. https://github.com/bbc/digital-paper-edit-electron/issues/4
Describe what the PR does
Adding the most basic test to timed-text-editor and also removing CustomEditor because it's a wrapper component for one single function - we don't really need it.
State whether the PR is ready for review or whether it needs extra work
Ready
Additional context
removing CustomEditor
You might want to check this change against this issue https://github.com/bbc/react-transcript-editor/issues/159 (which is the reason why it was initially separated into its own component)
see https://github.com/bbc/react-transcript-editor/pull/160 for more details.
TL;DR: using react inspector tool highlight updates you can see if removing CustomEditor as separate component increases the number of unnecessary re-renders. You'll have to judge it based on colour.
A very good catch, the re-renders definitely don't happen for the original master.

vs this branch:
onChange and handleKeyCommand makes the Editor re-render.
https://github.com/facebook/react/issues/16437#issuecomment-524892514 The original highlighting function has disappeared but instead you can use the profiler to record the rendering.
Added back the Editor as a memoized react component, and now the re-renders are gone.
