react + semantic ui: 访问列宽

react + semantic ui: access column width

我正在使用 grid component,根据文档,Row.Column 组件有一个 width 属性,我想访问它。

class MainGrid extends Component {
  render() {
    return (
      <Grid>
        <Grid.Row columns={2}>
          <Grid.Column>
            <JsonEditor
              width={???} // <---- I'd like to set the width property with the column's width property
            />
          </Grid.Column>
          <Grid.Column>
          </Grid.Column>
        </Grid.Row>

        <Grid.Row columns={1}>
        </Grid.Row>
      </Grid>
    );
  }
}

如果我理解正确的话,我的 JsonEditor 组件可以使用 Row.Column 属性,因为它将 属性 从父级传递给子级。但我不知道该怎么做。

假设 JsonEditor 是 react-ace editor, you should be able to set width to 100% to get an editor the full width of the containing column. The value is passed to the style attribute verbatim 的包装器。

这意味着的建议是赚钱的!