How to work with nested items? #315
Answered
by
piecyk
KazimirPodolski
asked this question in
Q&A
|
I have a number of form inputs which I want to virtualize. The problems is, they span across multiple hierarchical components, and I cannot come up with a way to 1) provide correct Consider this (virtual, but realistic) example: const TextInput = (props) => <input ... />;
const DateInput = (props) => <input ... />;
const SomeReusableSubform = () => (
<>
<TextInput />
<DateInput />
</>
);
const AnotherReusableSubform = () => (
<>
<TextInput />
{[1,2,3,4].map((num) => <TextInput />)}
</>
);
const Form = () => {
const virtualizer = useVirtualizer({
count: ???,
estimateSize: ???,
getScrollElement: someRef
});
return (
<>
<TextInput />
<DateInput />
<SomeReusableSubform />
<AnotherReusableSubform />
</>
);
}How to virtualize it? |
Answered by
piecyk
Jun 9, 2022
Replies: 1 comment 4 replies
|
Hi, don't fully understand where it's going, but virtualization works on flat list. Is this form created based on some template? then maybe you can map it also for virtualizer. |
4 replies
Answer selected by
KazimirPodolski
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi, don't fully understand where it's going, but virtualization works on flat list. Is this form created based on some template? then maybe you can map it also for virtualizer.