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

Conditional elements rendering out of order with only two siblings #172

nicknisi opened this issue Nov 15, 2018 · 0 comments


Copy link

commented Nov 15, 2018


If a sibling element is conditionally rendered, it is rendered out of order, unless there is a third node.

Package Version: 4.0.0

A reproducible CodeSandbox: and
it's working in because it has an extra sibling

class App extends WidgetBase {
  protected bigPredicate(contentRect: ContentRect) {
    return contentRect.width > 768;
  protected render() {
    const { isBig } = this.meta(Resize).get("root", {
      isBig: this.bigPredicate
    return (
      <div key="root">
        {isBig && <h1>First</h1>}
        {/* Adding a third node fixes it <h3>Third</h3> */}

Expected behavior:

I would expect <h1>First</h1> to be rendered before <h2>Second</h2>.

Actual behavior:

<h2>Second</h2> is rendered before <h1>First</h1>.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
1 participant
You can’t perform that action at this time.