Q:

Properties undefined on getInitialState

React noob here, trying to set an initial value for my checkbox control.  I set the property and am trying to set the state to the property value using the getInitialState.  Problem is, the props seem to be undefined in the getInitialState.  I've simplified and created a jsbin to show the issue.https://jsbin.com/cujeveh/edit?html,js,console,output
var testcontrol = React.createClass({
    getInitialState: function () {
        return { testval: this.props.testval };
    },
    render: function() {
        return (
        <input type="checkbox" checked={this.state.testval?"checked":""}}/>
        );
    }
});
React.render(
    <Container lblOn="yup" lblOff="nope"
       buttonText="saveit" testval="1" />, document.body);

Also within the jsbin, tried the componentDidMount method with the same result.  If I update the getInitialState to replace the prop with a hardcoded value, everything works fine.  I did read the React docs here and did see the antipattern statement but am only trying to set the initial state which I understood as okay. 

A:

In your example, you're setting testval prop on the <Container> component, but not on the <Chkbox1> component, which is the component that is checking for it.  Probably a minor oversight.  You just need to change:
<Chkbox1 ref="box1" lblOn={this.props.lblOn} 
         lblOff={this.props.lblOff} />

to
<Chkbox1 ref="box1" lblOn={this.props.lblOn} 
         lblOff={this.props.lblOff} testval={this.props.testval}/>

