0

更新:我发现 ModalTrigger 已被弃用:1b1af04 [changed] deprecate

现在我正在调查这个。

我在使用 react-bootstrap ModalTrigger 时遇到问题。以下使用工作,但升级到
“react-bootstrap”:“^0.25.1”,
“react”:“^0.13.3”,

我收到以下错误:未捕获的类型错误:无法读取未定义的属性“toUpperCase”

你知道为什么吗?

export default class Test extends React.Component {

    constructor(props) {    
      super(props);
      this.close = this.close.bind(this);
    }

  close(){
    this.setState({ showModal: false });
  }

    render() {

      var mymodal = ( 
        <Modal show={true} onHide={this.close}>
          <Modal.Header closeButton>
            <Modal.Title>Modal heading</Modal.Title>
          </Modal.Header>
          <Modal.Body>
            <h4>Text</h4>
          </Modal.Body>
          <Modal.Footer>
            <Button onClick={this.close}>Close</Button>
          </Modal.Footer>
        </Modal>
      )

        return (
        <Table striped bordered condensed hover>
          <thead>
            <tr>
              <th>
                <ModalTrigger key='modalinput' modal={mymodal}>

                  <Button style={buttonStyle}>
                    <span className="glyphicon glyphicon-plus" aria-hidden="true"></span>
                  </Button>

                </ModalTrigger>
              </th>
              <th>X</th>
              <th>Y</th>
            </tr>
          </thead>
          <tbody>


          </tbody>
        </Table>
        );

    } // Render

  }; // Component
4

1 回答 1

0

ModalTrigger 已弃用,您现在只需使用 Modal:

于 2015-09-03T14:36:16.060 回答