GriddleGriddle / Griddle

Simple Grid Component written in React
http://griddlegriddle.github.io/Griddle/
MIT License
2.5k stars 377 forks source link

when <RowDefinition> children contains <ColumnDefinition> and an array of <ColumnDefinition> #836

Open JaosnHsieh opened 5 years ago

JaosnHsieh commented 5 years ago

Griddle version

1.13.1

Expected Behavior

Work as flat array of <ColumnDefinition> is flat elements.

Actual Behavior

TypeError: Cannot read property 'id' of undefined

Steps to reproduce

const data = [
  {
    name: "data1",
    name1: 111,
    name2: 222
  },
  {
    name: "data2",
    name1: 333,
    name2: 444
  }
];
class App extends Component {
  render() {
    return (
      <Griddle data={data} plugins={[plugins.LocalPlugin]}>
        <RowDefinition>
          <ColumnDefinition id={"name"} title={"name"} />
          {["name1", "name2"].map(c => {
            return <ColumnDefinition key={c} id={c} title={c} />;
          })}
        </RowDefinition>
      </Griddle>
    );
  }
}