-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Nested map (for cells in a grid) #35
Comments
|
in few words, I think you want to rather do this: render = () => {
console.log(this._columnRange); // [0, 1]
console.log(this._rowRange); // [0, 1, 2, 3, 4, 5, 6, 7]
const canvas = html`
<div class="canvas" style=${`width:${this._canvasWidth}px;height:${this._canvasHeight}px`}>
${this._rowRange.map(
rowIndex =>
html`<div>${
this._columnRange.map(columnIndex => html`<div>cell</div>`
)}</div>`
)}
</div>
`;
render(this._root, canvas);
}; or you gotta explain me what you are trying to do ... but in any case, |
Whoops that was it, I had it left over from when I hadn't wrapped it in |
Hey thanks for the lib looks sweet. I'm checking I have the syntax here right (guessing not) as it throws on subsequent renders after the first one:
This is to render a range of cells in a virtual window, and the second render has the same range values. On the second render it throws the following error:
Where am I going wrong here? Also I see perf seems to be about the same with non-keyed items on https://github.com/krausest/js-framework-benchmark which is cool, but not sure how it's being done e.g. maybe the html strings need to be unique? (which they would be once I add the styles to them). Thanks
The text was updated successfully, but these errors were encountered: