Closed klappy closed 4 years ago
DoD: Higher order components are replaced with custom Hooks and context API. All HOCs are replaced.
This issue is testable on both RCL and App
0.9.0-rc.5
: https://develop--tc-create-app.netlify.app/Overall functionality should be identical but more performant when scrolling through a TSV.
0.9.0-rc.6: Small books like Titus opens fairly faster, but books like Mathew and Acts are taking nearly 5-7 secs to load the scripture pane when scrolling down the page. It takes 4-5 seconds for scripture pane to load when move from one page to another. Scripture pane loading performance.mp4.zip
Performance on larger books will be enhanced by rcl-#23.
@birchamp closed this issue as it's done.
There are a series of Higher Order Components that follow the old paradigm of React. We need to replace those with the newer Custom Hooks paradigm.
Gitea React Toolkit has a model to pattern using
useRepository
andRepositoryContext
.Replace existing
[x]
usfm/withUsfm.js
useUsfm.js
: custom hook for a Usfm.useUsfm.md
: document and example.Usfm.context.js
: context api.Usfm.context.md
: document and example.[x]
selections/withSelections.js
useSelections.js
: custom hook for a selection.useSelections.md
: document and example.Selections.context.js
: context api.Selections.context.md
: document and example.[x]
resources/withResource.js
andresources/withResources.js
useResource.js
: custom hook for a single resource.useResource.md
: document and example.Resources.context.js
: context api for multiple resource.Resources.context.md
: document and example.Update examples that leverage the older HOC's