javascript - ReferenceError: className is not defined -
in rails app using reactjs have coffescript code looks this:
dom = react.dom createnewmeetupform = react.createclass getinitialstate: -> { title: '' description: '' } titlechanged: (event) -> @setstate(title: event.target.value) descriptionchanged: (event) -> @setstate(description: event.target.value) render : -> dom.form classname: 'form-horizontal' dom.fieldset null, dom.legend null, "new meetup" dom.div classname: 'form-group' dom.label htmlfor: 'title' classname: 'col-lg-2 control-label' 'title' dom.div classname: 'col-lg-10' dom.input classname 'form-control' placeholder: 'meetup title' id: 'title' type: 'text' value: @state.title onchange: @titlechanged dom.div classname: 'form-group' dom.label htmlfor: "title" classname 'col-lg-2 control-label' 'description' dom.div classname "col-lg-10" dom.input classname 'form-control' placeholder: 'meetup description' id: 'description' type: 'text' value: @state.description onchanage: @descriptionchanged createnewmeetupform = react.createfactory(createnewmeetupform) $ -> react.render( createnewmeetupform(), document.body )
it returns me following error:
referenceerror: classname not defined
how can fix that?
in 3 instances within last block of code, use label classname
without colon:
classname 'col-lg-2 control-label'
classname "col-lg-10"
classname 'form-control'
the rest of code uses classname:
Comments
Post a Comment