-
Notifications
You must be signed in to change notification settings - Fork 56
Closed
Description
Currently, the row component can only access row
, which means no information about the outside world — for example, we can't highlight some text that's being used to filter rows, because we can't pass down the filter text.
Maybe something like this:
<VirtualList items={{...}} component={{...}} props='{{ { foo, bar } }}' />
Then, it would be passed to the row like so:
<:Component {component} {{...props}} row={{item.data}} />
The props=
is a little unfortunate, especially since it means having a clusterfuck of curly braces. This is one place where the React model wins, because you can do this:
const { items, component, ...props } = this.props;
return visible.map(item =>
<Component {...props} row={item.data} />
);
In Svelte there isn't a great way to accomplish that. Even the {{...this}}
proposal (sveltejs/svelte#1303) doesn't really help, though I suppose it'd be possible to do this:
<:Component {component} {{...(exclude(this, ['items', 'component'])}} row={{item.data}} />
Metadata
Metadata
Assignees
Labels
No labels