This repository was archived by the owner on Mar 4, 2020. It is now read-only.
feat(Tree): add virtualized tree prototype#1890
Merged
jurokapsiar merged 22 commits intomasterfrom Sep 13, 2019
Merged
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1890 +/- ##
==========================================
- Coverage 70.5% 70.47% -0.04%
==========================================
Files 884 884
Lines 7794 7796 +2
Branches 2278 2280 +2
==========================================
- Hits 5495 5494 -1
- Misses 2289 2291 +2
- Partials 10 11 +1
Continue to review full report at Codecov.
|
levithomason
reviewed
Sep 5, 2019
|
|
||
| function generateLevel(level, parent = '') { | ||
| const result = [] | ||
| for (let index = 0; index < getItemsNumber(minItems, maxItems); index++) { |
Co-Authored-By: Oleksandr Fediashov <olfedias@microsoft.com>
…com/stardust-ui/react into feat/add-virtualized-tree-prototype
| const cache = new CellMeasurerCache({ | ||
| defaultHeight: 20, | ||
| fixedWidth: true, | ||
| }) |
Member
There was a problem hiding this comment.
Should it be persistent between renders?
const [cache] = React.useState(() =>
new CellMeasurerCache({
defaultHeight: 20,
fixedWidth: true,
})
)
Collaborator
Author
There was a problem hiding this comment.
not sure, I just looked at his example.
probably not needed.
Member
Collaborator
Author
|
@layershifter if you go to http://bvaughn.github.io/react-virtualized/#/components/List and make the row size ~20 px those take a while to render as well. probably it will perform better if we had fewer, taller items in our example. |
layershifter
approved these changes
Sep 13, 2019
jurokapsiar
approved these changes
Sep 13, 2019
layershifter
pushed a commit
that referenced
this pull request
Sep 13, 2019
* add react-virtualized to package and yarn lock * add virtualized render prop to Tree * add virtualized tree in prototypes * add alternative solution in comments * add back as any from merging master * have refs for all items * fix the cloneElement approach * fix ref issue * increase virtualized tree size * rename the render prop * add changelog * fix use of prop name * move items code from prototype * address code review * make prototype public Co-Authored-By: Oleksandr Fediashov <olfedias@microsoft.com> * use lodash times function (cherry picked from commit 6935b97)
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Attempt to provide virtualization capability to a
Treevia a render prop.react-virtualizedadds astyleparam to the component it renders, and it needs to be there at render.Tried
React.cloneElementto continue to pass rendered items to the Virtualized render prop but it's not working as expected.Added another way of doing it by Tree passing render callbacks to the Virtualized render prop, that will render it along with the
styleprop, and that works.Work in progress.