Skip to content
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

Fix reordering components that return Fragments #1

Open
luwes opened this issue Jan 16, 2022 · 0 comments
Open

Fix reordering components that return Fragments #1

luwes opened this issue Jan 16, 2022 · 0 comments
Labels
help wanted Extra attention is needed

Comments

@luwes
Copy link
Owner

luwes commented Jan 16, 2022

This should ideally work, I couldn't find a solution right away.
This PR fixed the same bug in Preact: preactjs/preact#1515

little-vdom/test.jsx

Lines 376 to 407 in 3b1b149

it.skip('should handle reordering components that return Fragments #1325', () => {
const X = (props) => {
return props.children;
}
const App = (props) => {
if (props.i === 0) {
return (
<div>
<X key={1}>1</X>
<X key={2}>2</X>
</div>
);
}
return (
<div>
<X key={2}>2</X>
<X key={1}>1</X>
</div>
);
}
render(<App i={0} />, scratch);
expect(scratch.textContent).to.equal('12');
clearLog();
console.log('----------------------------------');
render(<App i={1} />, scratch);
console.log(getLog());
expect(scratch.textContent).to.equal('21');
});

@luwes luwes added the help wanted Extra attention is needed label Jan 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant