📜  反应中的三元道具 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:03:05.377000             🧑  作者: Mango

代码示例1
var React = require('React');

var MyOwnInput = React.createClass({
    render: function () {
        return (
            
); } }); module.exports = React.createClass({ getInitialState: function () { return { isRequired: false } }, componentDidMount: function () { this.setState({ isRequired: true }); }, render: function () { var isRequired = this.state.isRequired; return ( ); } });