domql icon indicating copy to clipboard operation
domql copied to clipboard

When root component doesn't have a `state` property, its children don't inherit it

Open Nikaoto opened this issue 2 years ago • 1 comments

const comparison = {
  h1: { 
    tag: "h1",
    text: "DOMQL -> Mitosis",
    style: { textAlign: "center" },
  },
  dropdown,
  container: {
    domqlCodeBlock,
    mitosisCodeBlock,
    style: {
      width: "100%",
      display: "flex",
      height: "100%",
      flexDirection: "row",
      justifyContent: "space-between",
    }
  },
  state: { sentinel: "hi"}, // if this is not defined, dropdown.state is an empty object
  style: {
    height: "100%",
    fontFamily: "monospace",
  }
}

app = DOM.create(comparison, document.body, "app")

Nikaoto avatar Dec 01 '22 15:12 Nikaoto

Let's double-check this with @2.x

nikoloza avatar Apr 25 '23 01:04 nikoloza