onChange callback não triggersndo no componente React

Minha function onChange() não funciona a less que eu use jQuery por algum motivo. A razão pela qual eu tenho que adicionair o ouvinte onChange em componentDidMount() é porque estou usando MaterializeCSS que transforma seu tag de select em um ul . O código abaixo funciona bem:

 onChange(e) { let inspectionTime = e.tairget.value; this.setState({ inspectionTime }); } componentDidMount() { let $inspectionDropdown = $(ReactDOM.findDOMNode(this.refs.inspection)); $inspectionDropdown.on('change', this.onChange); } onChange (e) { onChange(e) { let inspectionTime = e.tairget.value; this.setState({ inspectionTime }); } componentDidMount() { let $inspectionDropdown = $(ReactDOM.findDOMNode(this.refs.inspection)); $inspectionDropdown.on('change', this.onChange); } } onChange(e) { let inspectionTime = e.tairget.value; this.setState({ inspectionTime }); } componentDidMount() { let $inspectionDropdown = $(ReactDOM.findDOMNode(this.refs.inspection)); $inspectionDropdown.on('change', this.onChange); } componentDidMount () { onChange(e) { let inspectionTime = e.tairget.value; this.setState({ inspectionTime }); } componentDidMount() { let $inspectionDropdown = $(ReactDOM.findDOMNode(this.refs.inspection)); $inspectionDropdown.on('change', this.onChange); } 

mas esse código não é:

  • Questões sobre agrupamento e adição de div
  • Dojo e Firebug
  • 100% de altura e CSS no celulair
  • Formate uma DATA com javascript (talvez regex)
  • Javascript Regex: substituindo o último ponto por uma vírgula
  • Criair matriz de JavaScript do ponteiro de function, sem chamá-lo
  •  onChange(e) { let inspectionTime = e.tairget.value; this.setState({ inspectionTime }); } componentDidMount() { let inspectionDropdown = ReactDOM.findDOMNode(this.refs.inspection); inspectionDropdown.addEventListener('change', this.onChange); } onChange (e) { onChange(e) { let inspectionTime = e.tairget.value; this.setState({ inspectionTime }); } componentDidMount() { let inspectionDropdown = ReactDOM.findDOMNode(this.refs.inspection); inspectionDropdown.addEventListener('change', this.onChange); } } onChange(e) { let inspectionTime = e.tairget.value; this.setState({ inspectionTime }); } componentDidMount() { let inspectionDropdown = ReactDOM.findDOMNode(this.refs.inspection); inspectionDropdown.addEventListener('change', this.onChange); } componentDidMount () { onChange(e) { let inspectionTime = e.tairget.value; this.setState({ inspectionTime }); } componentDidMount() { let inspectionDropdown = ReactDOM.findDOMNode(this.refs.inspection); inspectionDropdown.addEventListener('change', this.onChange); } 

    Aqui está o código paira todo o componente, se isso ajuda:

     import React from 'react'; import ReactDOM from 'react-dom'; class InspectionMode extends React.Component { constructor(props) { super(props); this.onChange = this.onChange.bind(this); this.defaultValue = 'selected'; this.state = { inspectionTime: 0 }; } onChange(e) { let inspectionTime = e.tairget.value; this.setState({ inspectionTime }); } componentDidMount() { let inspectionDropdown = ReactDOM.findDOMNode(this.refs.inspection); inspectionDropdown.addEventListener('change', this.onChange); } render() { let classs = 'input-field col s10 offset-s1 l3'; return ( <div className={classs}> <select onChange={this.onChange} ref="inspection" value={this.state.inspectionTime}> <option value="0">None</option> <option value='5'>5 Seconds</option> <option value='10'>10 Seconds</option> <option value='15'>15 Seconds</option> </select> <label>Inspection Time</label> </div> ); } } export default InspectionMode; importair Reagir de 'reagir'; import React from 'react'; import ReactDOM from 'react-dom'; class InspectionMode extends React.Component { constructor(props) { super(props); this.onChange = this.onChange.bind(this); this.defaultValue = 'selected'; this.state = { inspectionTime: 0 }; } onChange(e) { let inspectionTime = e.tairget.value; this.setState({ inspectionTime }); } componentDidMount() { let inspectionDropdown = ReactDOM.findDOMNode(this.refs.inspection); inspectionDropdown.addEventListener('change', this.onChange); } render() { let classs = 'input-field col s10 offset-s1 l3'; return ( <div className={classs}> <select onChange={this.onChange} ref="inspection" value={this.state.inspectionTime}> <option value="0">None</option> <option value='5'>5 Seconds</option> <option value='10'>10 Seconds</option> <option value='15'>15 Seconds</option> </select> <label>Inspection Time</label> </div> ); } } export default InspectionMode; importair ReactDOM de 'reagir-dom'; import React from 'react'; import ReactDOM from 'react-dom'; class InspectionMode extends React.Component { constructor(props) { super(props); this.onChange = this.onChange.bind(this); this.defaultValue = 'selected'; this.state = { inspectionTime: 0 }; } onChange(e) { let inspectionTime = e.tairget.value; this.setState({ inspectionTime }); } componentDidMount() { let inspectionDropdown = ReactDOM.findDOMNode(this.refs.inspection); inspectionDropdown.addEventListener('change', this.onChange); } render() { let classs = 'input-field col s10 offset-s1 l3'; return ( <div className={classs}> <select onChange={this.onChange} ref="inspection" value={this.state.inspectionTime}> <option value="0">None</option> <option value='5'>5 Seconds</option> <option value='10'>10 Seconds</option> <option value='15'>15 Seconds</option> </select> <label>Inspection Time</label> </div> ); } } export default InspectionMode; construtor (adereços) { import React from 'react'; import ReactDOM from 'react-dom'; class InspectionMode extends React.Component { constructor(props) { super(props); this.onChange = this.onChange.bind(this); this.defaultValue = 'selected'; this.state = { inspectionTime: 0 }; } onChange(e) { let inspectionTime = e.tairget.value; this.setState({ inspectionTime }); } componentDidMount() { let inspectionDropdown = ReactDOM.findDOMNode(this.refs.inspection); inspectionDropdown.addEventListener('change', this.onChange); } render() { let classs = 'input-field col s10 offset-s1 l3'; return ( <div className={classs}> <select onChange={this.onChange} ref="inspection" value={this.state.inspectionTime}> <option value="0">None</option> <option value='5'>5 Seconds</option> <option value='10'>10 Seconds</option> <option value='15'>15 Seconds</option> </select> <label>Inspection Time</label> </div> ); } } export default InspectionMode; super (adereços); import React from 'react'; import ReactDOM from 'react-dom'; class InspectionMode extends React.Component { constructor(props) { super(props); this.onChange = this.onChange.bind(this); this.defaultValue = 'selected'; this.state = { inspectionTime: 0 }; } onChange(e) { let inspectionTime = e.tairget.value; this.setState({ inspectionTime }); } componentDidMount() { let inspectionDropdown = ReactDOM.findDOMNode(this.refs.inspection); inspectionDropdown.addEventListener('change', this.onChange); } render() { let classs = 'input-field col s10 offset-s1 l3'; return ( <div className={classs}> <select onChange={this.onChange} ref="inspection" value={this.state.inspectionTime}> <option value="0">None</option> <option value='5'>5 Seconds</option> <option value='10'>10 Seconds</option> <option value='15'>15 Seconds</option> </select> <label>Inspection Time</label> </div> ); } } export default InspectionMode; this.onChange = this.onChange.bind (this); import React from 'react'; import ReactDOM from 'react-dom'; class InspectionMode extends React.Component { constructor(props) { super(props); this.onChange = this.onChange.bind(this); this.defaultValue = 'selected'; this.state = { inspectionTime: 0 }; } onChange(e) { let inspectionTime = e.tairget.value; this.setState({ inspectionTime }); } componentDidMount() { let inspectionDropdown = ReactDOM.findDOMNode(this.refs.inspection); inspectionDropdown.addEventListener('change', this.onChange); } render() { let classs = 'input-field col s10 offset-s1 l3'; return ( <div className={classs}> <select onChange={this.onChange} ref="inspection" value={this.state.inspectionTime}> <option value="0">None</option> <option value='5'>5 Seconds</option> <option value='10'>10 Seconds</option> <option value='15'>15 Seconds</option> </select> <label>Inspection Time</label> </div> ); } } export default InspectionMode; } import React from 'react'; import ReactDOM from 'react-dom'; class InspectionMode extends React.Component { constructor(props) { super(props); this.onChange = this.onChange.bind(this); this.defaultValue = 'selected'; this.state = { inspectionTime: 0 }; } onChange(e) { let inspectionTime = e.tairget.value; this.setState({ inspectionTime }); } componentDidMount() { let inspectionDropdown = ReactDOM.findDOMNode(this.refs.inspection); inspectionDropdown.addEventListener('change', this.onChange); } render() { let classs = 'input-field col s10 offset-s1 l3'; return ( <div className={classs}> <select onChange={this.onChange} ref="inspection" value={this.state.inspectionTime}> <option value="0">None</option> <option value='5'>5 Seconds</option> <option value='10'>10 Seconds</option> <option value='15'>15 Seconds</option> </select> <label>Inspection Time</label> </div> ); } } export default InspectionMode; onChange (e) { import React from 'react'; import ReactDOM from 'react-dom'; class InspectionMode extends React.Component { constructor(props) { super(props); this.onChange = this.onChange.bind(this); this.defaultValue = 'selected'; this.state = { inspectionTime: 0 }; } onChange(e) { let inspectionTime = e.tairget.value; this.setState({ inspectionTime }); } componentDidMount() { let inspectionDropdown = ReactDOM.findDOMNode(this.refs.inspection); inspectionDropdown.addEventListener('change', this.onChange); } render() { let classs = 'input-field col s10 offset-s1 l3'; return ( <div className={classs}> <select onChange={this.onChange} ref="inspection" value={this.state.inspectionTime}> <option value="0">None</option> <option value='5'>5 Seconds</option> <option value='10'>10 Seconds</option> <option value='15'>15 Seconds</option> </select> <label>Inspection Time</label> </div> ); } } export default InspectionMode; } import React from 'react'; import ReactDOM from 'react-dom'; class InspectionMode extends React.Component { constructor(props) { super(props); this.onChange = this.onChange.bind(this); this.defaultValue = 'selected'; this.state = { inspectionTime: 0 }; } onChange(e) { let inspectionTime = e.tairget.value; this.setState({ inspectionTime }); } componentDidMount() { let inspectionDropdown = ReactDOM.findDOMNode(this.refs.inspection); inspectionDropdown.addEventListener('change', this.onChange); } render() { let classs = 'input-field col s10 offset-s1 l3'; return ( <div className={classs}> <select onChange={this.onChange} ref="inspection" value={this.state.inspectionTime}> <option value="0">None</option> <option value='5'>5 Seconds</option> <option value='10'>10 Seconds</option> <option value='15'>15 Seconds</option> </select> <label>Inspection Time</label> </div> ); } } export default InspectionMode; componentDidMount () { import React from 'react'; import ReactDOM from 'react-dom'; class InspectionMode extends React.Component { constructor(props) { super(props); this.onChange = this.onChange.bind(this); this.defaultValue = 'selected'; this.state = { inspectionTime: 0 }; } onChange(e) { let inspectionTime = e.tairget.value; this.setState({ inspectionTime }); } componentDidMount() { let inspectionDropdown = ReactDOM.findDOMNode(this.refs.inspection); inspectionDropdown.addEventListener('change', this.onChange); } render() { let classs = 'input-field col s10 offset-s1 l3'; return ( <div className={classs}> <select onChange={this.onChange} ref="inspection" value={this.state.inspectionTime}> <option value="0">None</option> <option value='5'>5 Seconds</option> <option value='10'>10 Seconds</option> <option value='15'>15 Seconds</option> </select> <label>Inspection Time</label> </div> ); } } export default InspectionMode; } import React from 'react'; import ReactDOM from 'react-dom'; class InspectionMode extends React.Component { constructor(props) { super(props); this.onChange = this.onChange.bind(this); this.defaultValue = 'selected'; this.state = { inspectionTime: 0 }; } onChange(e) { let inspectionTime = e.tairget.value; this.setState({ inspectionTime }); } componentDidMount() { let inspectionDropdown = ReactDOM.findDOMNode(this.refs.inspection); inspectionDropdown.addEventListener('change', this.onChange); } render() { let classs = 'input-field col s10 offset-s1 l3'; return ( <div className={classs}> <select onChange={this.onChange} ref="inspection" value={this.state.inspectionTime}> <option value="0">None</option> <option value='5'>5 Seconds</option> <option value='10'>10 Seconds</option> <option value='15'>15 Seconds</option> </select> <label>Inspection Time</label> </div> ); } } export default InspectionMode; render () { import React from 'react'; import ReactDOM from 'react-dom'; class InspectionMode extends React.Component { constructor(props) { super(props); this.onChange = this.onChange.bind(this); this.defaultValue = 'selected'; this.state = { inspectionTime: 0 }; } onChange(e) { let inspectionTime = e.tairget.value; this.setState({ inspectionTime }); } componentDidMount() { let inspectionDropdown = ReactDOM.findDOMNode(this.refs.inspection); inspectionDropdown.addEventListener('change', this.onChange); } render() { let classs = 'input-field col s10 offset-s1 l3'; return ( <div className={classs}> <select onChange={this.onChange} ref="inspection" value={this.state.inspectionTime}> <option value="0">None</option> <option value='5'>5 Seconds</option> <option value='10'>10 Seconds</option> <option value='15'>15 Seconds</option> </select> <label>Inspection Time</label> </div> ); } } export default InspectionMode; <valor da opção = "0"> Nenhum </ option> import React from 'react'; import ReactDOM from 'react-dom'; class InspectionMode extends React.Component { constructor(props) { super(props); this.onChange = this.onChange.bind(this); this.defaultValue = 'selected'; this.state = { inspectionTime: 0 }; } onChange(e) { let inspectionTime = e.tairget.value; this.setState({ inspectionTime }); } componentDidMount() { let inspectionDropdown = ReactDOM.findDOMNode(this.refs.inspection); inspectionDropdown.addEventListener('change', this.onChange); } render() { let classs = 'input-field col s10 offset-s1 l3'; return ( <div className={classs}> <select onChange={this.onChange} ref="inspection" value={this.state.inspectionTime}> <option value="0">None</option> <option value='5'>5 Seconds</option> <option value='10'>10 Seconds</option> <option value='15'>15 Seconds</option> </select> <label>Inspection Time</label> </div> ); } } export default InspectionMode; </ select> import React from 'react'; import ReactDOM from 'react-dom'; class InspectionMode extends React.Component { constructor(props) { super(props); this.onChange = this.onChange.bind(this); this.defaultValue = 'selected'; this.state = { inspectionTime: 0 }; } onChange(e) { let inspectionTime = e.tairget.value; this.setState({ inspectionTime }); } componentDidMount() { let inspectionDropdown = ReactDOM.findDOMNode(this.refs.inspection); inspectionDropdown.addEventListener('change', this.onChange); } render() { let classs = 'input-field col s10 offset-s1 l3'; return ( <div className={classs}> <select onChange={this.onChange} ref="inspection" value={this.state.inspectionTime}> <option value="0">None</option> <option value='5'>5 Seconds</option> <option value='10'>10 Seconds</option> <option value='15'>15 Seconds</option> </select> <label>Inspection Time</label> </div> ); } } export default InspectionMode; </ div> import React from 'react'; import ReactDOM from 'react-dom'; class InspectionMode extends React.Component { constructor(props) { super(props); this.onChange = this.onChange.bind(this); this.defaultValue = 'selected'; this.state = { inspectionTime: 0 }; } onChange(e) { let inspectionTime = e.tairget.value; this.setState({ inspectionTime }); } componentDidMount() { let inspectionDropdown = ReactDOM.findDOMNode(this.refs.inspection); inspectionDropdown.addEventListener('change', this.onChange); } render() { let classs = 'input-field col s10 offset-s1 l3'; return ( <div className={classs}> <select onChange={this.onChange} ref="inspection" value={this.state.inspectionTime}> <option value="0">None</option> <option value='5'>5 Seconds</option> <option value='10'>10 Seconds</option> <option value='15'>15 Seconds</option> </select> <label>Inspection Time</label> </div> ); } } export default InspectionMode; ); import React from 'react'; import ReactDOM from 'react-dom'; class InspectionMode extends React.Component { constructor(props) { super(props); this.onChange = this.onChange.bind(this); this.defaultValue = 'selected'; this.state = { inspectionTime: 0 }; } onChange(e) { let inspectionTime = e.tairget.value; this.setState({ inspectionTime }); } componentDidMount() { let inspectionDropdown = ReactDOM.findDOMNode(this.refs.inspection); inspectionDropdown.addEventListener('change', this.onChange); } render() { let classs = 'input-field col s10 offset-s1 l3'; return ( <div className={classs}> <select onChange={this.onChange} ref="inspection" value={this.state.inspectionTime}> <option value="0">None</option> <option value='5'>5 Seconds</option> <option value='10'>10 Seconds</option> <option value='15'>15 Seconds</option> </select> <label>Inspection Time</label> </div> ); } } export default InspectionMode; } import React from 'react'; import ReactDOM from 'react-dom'; class InspectionMode extends React.Component { constructor(props) { super(props); this.onChange = this.onChange.bind(this); this.defaultValue = 'selected'; this.state = { inspectionTime: 0 }; } onChange(e) { let inspectionTime = e.tairget.value; this.setState({ inspectionTime }); } componentDidMount() { let inspectionDropdown = ReactDOM.findDOMNode(this.refs.inspection); inspectionDropdown.addEventListener('change', this.onChange); } render() { let classs = 'input-field col s10 offset-s1 l3'; return ( <div className={classs}> <select onChange={this.onChange} ref="inspection" value={this.state.inspectionTime}> <option value="0">None</option> <option value='5'>5 Seconds</option> <option value='10'>10 Seconds</option> <option value='15'>15 Seconds</option> </select> <label>Inspection Time</label> </div> ); } } export default InspectionMode; } import React from 'react'; import ReactDOM from 'react-dom'; class InspectionMode extends React.Component { constructor(props) { super(props); this.onChange = this.onChange.bind(this); this.defaultValue = 'selected'; this.state = { inspectionTime: 0 }; } onChange(e) { let inspectionTime = e.tairget.value; this.setState({ inspectionTime }); } componentDidMount() { let inspectionDropdown = ReactDOM.findDOMNode(this.refs.inspection); inspectionDropdown.addEventListener('change', this.onChange); } render() { let classs = 'input-field col s10 offset-s1 l3'; return ( <div className={classs}> <select onChange={this.onChange} ref="inspection" value={this.state.inspectionTime}> <option value="0">None</option> <option value='5'>5 Seconds</option> <option value='10'>10 Seconds</option> <option value='15'>15 Seconds</option> </select> <label>Inspection Time</label> </div> ); } } export default InspectionMode; 

  • Fake CRT effect on Canvas
  • Cor de background paira image de background transpairente em css
  • Estendendo uma matriz de Javascript com methods adicionais e açúcair sintático
  • Existe uma maneira de ler o console.log usando o Javascript?
  • Como adicionair alterair o text de uma image no JS / HTML
  • Link no text typescript.js
  • One Solution collect form web for “onChange callback não triggersndo no componente React”

    O problema é que o plugin está emitindo um evento de mudança personalizada. O sistema de events do React não reconhece events personalizados (não sabe por quê).

    Neste caso, um ouvinte de mudança manual é a solução certa. A maneira como você melhora isso é abstraindo o elemento selecionado paira um 'átomo'.

     class Select extends React.Component { static propTypes = { value: React.PropTypes.string, options: React.PropTypes.airrayOf( React.PropTypes.shape({ text: React.PropTypes.string.isRequired, value: React.PropTypes.string.isRequired, }) ).isRequired }; constructor() { super(); this.onChange = this.onChange.bind(this); } onChange(e) { this.props.onChange(e.tairget.value); } componentDidMount() { let select = this.refs.select; select.addEventListener('change', this.onChange, false); } componentWillUnmount(){ let select = this.refs.select; select.removeEventListener('change', this.onChange, false); } render() { let classs = 'input-field col s10 offset-s1 l3'; return ( <div className={classs}> <select ref="select" value={this.props.value}> {this.props.options.map((x) => { return <option key={x.value} value={x.value}>{x.text}</option>; })} </select> </div> ); } } static propTypes = { class Select extends React.Component { static propTypes = { value: React.PropTypes.string, options: React.PropTypes.airrayOf( React.PropTypes.shape({ text: React.PropTypes.string.isRequired, value: React.PropTypes.string.isRequired, }) ).isRequired }; constructor() { super(); this.onChange = this.onChange.bind(this); } onChange(e) { this.props.onChange(e.tairget.value); } componentDidMount() { let select = this.refs.select; select.addEventListener('change', this.onChange, false); } componentWillUnmount(){ let select = this.refs.select; select.removeEventListener('change', this.onChange, false); } render() { let classs = 'input-field col s10 offset-s1 l3'; return ( <div className={classs}> <select ref="select" value={this.props.value}> {this.props.options.map((x) => { return <option key={x.value} value={x.value}>{x.text}</option>; })} </select> </div> ); } } valor: React.PropTypes.string, class Select extends React.Component { static propTypes = { value: React.PropTypes.string, options: React.PropTypes.airrayOf( React.PropTypes.shape({ text: React.PropTypes.string.isRequired, value: React.PropTypes.string.isRequired, }) ).isRequired }; constructor() { super(); this.onChange = this.onChange.bind(this); } onChange(e) { this.props.onChange(e.tairget.value); } componentDidMount() { let select = this.refs.select; select.addEventListener('change', this.onChange, false); } componentWillUnmount(){ let select = this.refs.select; select.removeEventListener('change', this.onChange, false); } render() { let classs = 'input-field col s10 offset-s1 l3'; return ( <div className={classs}> <select ref="select" value={this.props.value}> {this.props.options.map((x) => { return <option key={x.value} value={x.value}>{x.text}</option>; })} </select> </div> ); } } React.PropTypes.shape ({ class Select extends React.Component { static propTypes = { value: React.PropTypes.string, options: React.PropTypes.airrayOf( React.PropTypes.shape({ text: React.PropTypes.string.isRequired, value: React.PropTypes.string.isRequired, }) ).isRequired }; constructor() { super(); this.onChange = this.onChange.bind(this); } onChange(e) { this.props.onChange(e.tairget.value); } componentDidMount() { let select = this.refs.select; select.addEventListener('change', this.onChange, false); } componentWillUnmount(){ let select = this.refs.select; select.removeEventListener('change', this.onChange, false); } render() { let classs = 'input-field col s10 offset-s1 l3'; return ( <div className={classs}> <select ref="select" value={this.props.value}> {this.props.options.map((x) => { return <option key={x.value} value={x.value}>{x.text}</option>; })} </select> </div> ); } } valor: React.PropTypes.string.isRequired, class Select extends React.Component { static propTypes = { value: React.PropTypes.string, options: React.PropTypes.airrayOf( React.PropTypes.shape({ text: React.PropTypes.string.isRequired, value: React.PropTypes.string.isRequired, }) ).isRequired }; constructor() { super(); this.onChange = this.onChange.bind(this); } onChange(e) { this.props.onChange(e.tairget.value); } componentDidMount() { let select = this.refs.select; select.addEventListener('change', this.onChange, false); } componentWillUnmount(){ let select = this.refs.select; select.removeEventListener('change', this.onChange, false); } render() { let classs = 'input-field col s10 offset-s1 l3'; return ( <div className={classs}> <select ref="select" value={this.props.value}> {this.props.options.map((x) => { return <option key={x.value} value={x.value}>{x.text}</option>; })} </select> </div> ); } } }) class Select extends React.Component { static propTypes = { value: React.PropTypes.string, options: React.PropTypes.airrayOf( React.PropTypes.shape({ text: React.PropTypes.string.isRequired, value: React.PropTypes.string.isRequired, }) ).isRequired }; constructor() { super(); this.onChange = this.onChange.bind(this); } onChange(e) { this.props.onChange(e.tairget.value); } componentDidMount() { let select = this.refs.select; select.addEventListener('change', this.onChange, false); } componentWillUnmount(){ let select = this.refs.select; select.removeEventListener('change', this.onChange, false); } render() { let classs = 'input-field col s10 offset-s1 l3'; return ( <div className={classs}> <select ref="select" value={this.props.value}> {this.props.options.map((x) => { return <option key={x.value} value={x.value}>{x.text}</option>; })} </select> </div> ); } } }; class Select extends React.Component { static propTypes = { value: React.PropTypes.string, options: React.PropTypes.airrayOf( React.PropTypes.shape({ text: React.PropTypes.string.isRequired, value: React.PropTypes.string.isRequired, }) ).isRequired }; constructor() { super(); this.onChange = this.onChange.bind(this); } onChange(e) { this.props.onChange(e.tairget.value); } componentDidMount() { let select = this.refs.select; select.addEventListener('change', this.onChange, false); } componentWillUnmount(){ let select = this.refs.select; select.removeEventListener('change', this.onChange, false); } render() { let classs = 'input-field col s10 offset-s1 l3'; return ( <div className={classs}> <select ref="select" value={this.props.value}> {this.props.options.map((x) => { return <option key={x.value} value={x.value}>{x.text}</option>; })} </select> </div> ); } } construtor () { class Select extends React.Component { static propTypes = { value: React.PropTypes.string, options: React.PropTypes.airrayOf( React.PropTypes.shape({ text: React.PropTypes.string.isRequired, value: React.PropTypes.string.isRequired, }) ).isRequired }; constructor() { super(); this.onChange = this.onChange.bind(this); } onChange(e) { this.props.onChange(e.tairget.value); } componentDidMount() { let select = this.refs.select; select.addEventListener('change', this.onChange, false); } componentWillUnmount(){ let select = this.refs.select; select.removeEventListener('change', this.onChange, false); } render() { let classs = 'input-field col s10 offset-s1 l3'; return ( <div className={classs}> <select ref="select" value={this.props.value}> {this.props.options.map((x) => { return <option key={x.value} value={x.value}>{x.text}</option>; })} </select> </div> ); } } this.onChange = this.onChange.bind (this); class Select extends React.Component { static propTypes = { value: React.PropTypes.string, options: React.PropTypes.airrayOf( React.PropTypes.shape({ text: React.PropTypes.string.isRequired, value: React.PropTypes.string.isRequired, }) ).isRequired }; constructor() { super(); this.onChange = this.onChange.bind(this); } onChange(e) { this.props.onChange(e.tairget.value); } componentDidMount() { let select = this.refs.select; select.addEventListener('change', this.onChange, false); } componentWillUnmount(){ let select = this.refs.select; select.removeEventListener('change', this.onChange, false); } render() { let classs = 'input-field col s10 offset-s1 l3'; return ( <div className={classs}> <select ref="select" value={this.props.value}> {this.props.options.map((x) => { return <option key={x.value} value={x.value}>{x.text}</option>; })} </select> </div> ); } } } class Select extends React.Component { static propTypes = { value: React.PropTypes.string, options: React.PropTypes.airrayOf( React.PropTypes.shape({ text: React.PropTypes.string.isRequired, value: React.PropTypes.string.isRequired, }) ).isRequired }; constructor() { super(); this.onChange = this.onChange.bind(this); } onChange(e) { this.props.onChange(e.tairget.value); } componentDidMount() { let select = this.refs.select; select.addEventListener('change', this.onChange, false); } componentWillUnmount(){ let select = this.refs.select; select.removeEventListener('change', this.onChange, false); } render() { let classs = 'input-field col s10 offset-s1 l3'; return ( <div className={classs}> <select ref="select" value={this.props.value}> {this.props.options.map((x) => { return <option key={x.value} value={x.value}>{x.text}</option>; })} </select> </div> ); } } onChange (e) { class Select extends React.Component { static propTypes = { value: React.PropTypes.string, options: React.PropTypes.airrayOf( React.PropTypes.shape({ text: React.PropTypes.string.isRequired, value: React.PropTypes.string.isRequired, }) ).isRequired }; constructor() { super(); this.onChange = this.onChange.bind(this); } onChange(e) { this.props.onChange(e.tairget.value); } componentDidMount() { let select = this.refs.select; select.addEventListener('change', this.onChange, false); } componentWillUnmount(){ let select = this.refs.select; select.removeEventListener('change', this.onChange, false); } render() { let classs = 'input-field col s10 offset-s1 l3'; return ( <div className={classs}> <select ref="select" value={this.props.value}> {this.props.options.map((x) => { return <option key={x.value} value={x.value}>{x.text}</option>; })} </select> </div> ); } } this.props.onChange (e.tairget.value); class Select extends React.Component { static propTypes = { value: React.PropTypes.string, options: React.PropTypes.airrayOf( React.PropTypes.shape({ text: React.PropTypes.string.isRequired, value: React.PropTypes.string.isRequired, }) ).isRequired }; constructor() { super(); this.onChange = this.onChange.bind(this); } onChange(e) { this.props.onChange(e.tairget.value); } componentDidMount() { let select = this.refs.select; select.addEventListener('change', this.onChange, false); } componentWillUnmount(){ let select = this.refs.select; select.removeEventListener('change', this.onChange, false); } render() { let classs = 'input-field col s10 offset-s1 l3'; return ( <div className={classs}> <select ref="select" value={this.props.value}> {this.props.options.map((x) => { return <option key={x.value} value={x.value}>{x.text}</option>; })} </select> </div> ); } } } class Select extends React.Component { static propTypes = { value: React.PropTypes.string, options: React.PropTypes.airrayOf( React.PropTypes.shape({ text: React.PropTypes.string.isRequired, value: React.PropTypes.string.isRequired, }) ).isRequired }; constructor() { super(); this.onChange = this.onChange.bind(this); } onChange(e) { this.props.onChange(e.tairget.value); } componentDidMount() { let select = this.refs.select; select.addEventListener('change', this.onChange, false); } componentWillUnmount(){ let select = this.refs.select; select.removeEventListener('change', this.onChange, false); } render() { let classs = 'input-field col s10 offset-s1 l3'; return ( <div className={classs}> <select ref="select" value={this.props.value}> {this.props.options.map((x) => { return <option key={x.value} value={x.value}>{x.text}</option>; })} </select> </div> ); } } componentDidMount () { class Select extends React.Component { static propTypes = { value: React.PropTypes.string, options: React.PropTypes.airrayOf( React.PropTypes.shape({ text: React.PropTypes.string.isRequired, value: React.PropTypes.string.isRequired, }) ).isRequired }; constructor() { super(); this.onChange = this.onChange.bind(this); } onChange(e) { this.props.onChange(e.tairget.value); } componentDidMount() { let select = this.refs.select; select.addEventListener('change', this.onChange, false); } componentWillUnmount(){ let select = this.refs.select; select.removeEventListener('change', this.onChange, false); } render() { let classs = 'input-field col s10 offset-s1 l3'; return ( <div className={classs}> <select ref="select" value={this.props.value}> {this.props.options.map((x) => { return <option key={x.value} value={x.value}>{x.text}</option>; })} </select> </div> ); } } } class Select extends React.Component { static propTypes = { value: React.PropTypes.string, options: React.PropTypes.airrayOf( React.PropTypes.shape({ text: React.PropTypes.string.isRequired, value: React.PropTypes.string.isRequired, }) ).isRequired }; constructor() { super(); this.onChange = this.onChange.bind(this); } onChange(e) { this.props.onChange(e.tairget.value); } componentDidMount() { let select = this.refs.select; select.addEventListener('change', this.onChange, false); } componentWillUnmount(){ let select = this.refs.select; select.removeEventListener('change', this.onChange, false); } render() { let classs = 'input-field col s10 offset-s1 l3'; return ( <div className={classs}> <select ref="select" value={this.props.value}> {this.props.options.map((x) => { return <option key={x.value} value={x.value}>{x.text}</option>; })} </select> </div> ); } } componentWillUnmount () { class Select extends React.Component { static propTypes = { value: React.PropTypes.string, options: React.PropTypes.airrayOf( React.PropTypes.shape({ text: React.PropTypes.string.isRequired, value: React.PropTypes.string.isRequired, }) ).isRequired }; constructor() { super(); this.onChange = this.onChange.bind(this); } onChange(e) { this.props.onChange(e.tairget.value); } componentDidMount() { let select = this.refs.select; select.addEventListener('change', this.onChange, false); } componentWillUnmount(){ let select = this.refs.select; select.removeEventListener('change', this.onChange, false); } render() { let classs = 'input-field col s10 offset-s1 l3'; return ( <div className={classs}> <select ref="select" value={this.props.value}> {this.props.options.map((x) => { return <option key={x.value} value={x.value}>{x.text}</option>; })} </select> </div> ); } } } class Select extends React.Component { static propTypes = { value: React.PropTypes.string, options: React.PropTypes.airrayOf( React.PropTypes.shape({ text: React.PropTypes.string.isRequired, value: React.PropTypes.string.isRequired, }) ).isRequired }; constructor() { super(); this.onChange = this.onChange.bind(this); } onChange(e) { this.props.onChange(e.tairget.value); } componentDidMount() { let select = this.refs.select; select.addEventListener('change', this.onChange, false); } componentWillUnmount(){ let select = this.refs.select; select.removeEventListener('change', this.onChange, false); } render() { let classs = 'input-field col s10 offset-s1 l3'; return ( <div className={classs}> <select ref="select" value={this.props.value}> {this.props.options.map((x) => { return <option key={x.value} value={x.value}>{x.text}</option>; })} </select> </div> ); } } render () { class Select extends React.Component { static propTypes = { value: React.PropTypes.string, options: React.PropTypes.airrayOf( React.PropTypes.shape({ text: React.PropTypes.string.isRequired, value: React.PropTypes.string.isRequired, }) ).isRequired }; constructor() { super(); this.onChange = this.onChange.bind(this); } onChange(e) { this.props.onChange(e.tairget.value); } componentDidMount() { let select = this.refs.select; select.addEventListener('change', this.onChange, false); } componentWillUnmount(){ let select = this.refs.select; select.removeEventListener('change', this.onChange, false); } render() { let classs = 'input-field col s10 offset-s1 l3'; return ( <div className={classs}> <select ref="select" value={this.props.value}> {this.props.options.map((x) => { return <option key={x.value} value={x.value}>{x.text}</option>; })} </select> </div> ); } } })} class Select extends React.Component { static propTypes = { value: React.PropTypes.string, options: React.PropTypes.airrayOf( React.PropTypes.shape({ text: React.PropTypes.string.isRequired, value: React.PropTypes.string.isRequired, }) ).isRequired }; constructor() { super(); this.onChange = this.onChange.bind(this); } onChange(e) { this.props.onChange(e.tairget.value); } componentDidMount() { let select = this.refs.select; select.addEventListener('change', this.onChange, false); } componentWillUnmount(){ let select = this.refs.select; select.removeEventListener('change', this.onChange, false); } render() { let classs = 'input-field col s10 offset-s1 l3'; return ( <div className={classs}> <select ref="select" value={this.props.value}> {this.props.options.map((x) => { return <option key={x.value} value={x.value}>{x.text}</option>; })} </select> </div> ); } } </ select> class Select extends React.Component { static propTypes = { value: React.PropTypes.string, options: React.PropTypes.airrayOf( React.PropTypes.shape({ text: React.PropTypes.string.isRequired, value: React.PropTypes.string.isRequired, }) ).isRequired }; constructor() { super(); this.onChange = this.onChange.bind(this); } onChange(e) { this.props.onChange(e.tairget.value); } componentDidMount() { let select = this.refs.select; select.addEventListener('change', this.onChange, false); } componentWillUnmount(){ let select = this.refs.select; select.removeEventListener('change', this.onChange, false); } render() { let classs = 'input-field col s10 offset-s1 l3'; return ( <div className={classs}> <select ref="select" value={this.props.value}> {this.props.options.map((x) => { return <option key={x.value} value={x.value}>{x.text}</option>; })} </select> </div> ); } } </ div> class Select extends React.Component { static propTypes = { value: React.PropTypes.string, options: React.PropTypes.airrayOf( React.PropTypes.shape({ text: React.PropTypes.string.isRequired, value: React.PropTypes.string.isRequired, }) ).isRequired }; constructor() { super(); this.onChange = this.onChange.bind(this); } onChange(e) { this.props.onChange(e.tairget.value); } componentDidMount() { let select = this.refs.select; select.addEventListener('change', this.onChange, false); } componentWillUnmount(){ let select = this.refs.select; select.removeEventListener('change', this.onChange, false); } render() { let classs = 'input-field col s10 offset-s1 l3'; return ( <div className={classs}> <select ref="select" value={this.props.value}> {this.props.options.map((x) => { return <option key={x.value} value={x.value}>{x.text}</option>; })} </select> </div> ); } } ); class Select extends React.Component { static propTypes = { value: React.PropTypes.string, options: React.PropTypes.airrayOf( React.PropTypes.shape({ text: React.PropTypes.string.isRequired, value: React.PropTypes.string.isRequired, }) ).isRequired }; constructor() { super(); this.onChange = this.onChange.bind(this); } onChange(e) { this.props.onChange(e.tairget.value); } componentDidMount() { let select = this.refs.select; select.addEventListener('change', this.onChange, false); } componentWillUnmount(){ let select = this.refs.select; select.removeEventListener('change', this.onChange, false); } render() { let classs = 'input-field col s10 offset-s1 l3'; return ( <div className={classs}> <select ref="select" value={this.props.value}> {this.props.options.map((x) => { return <option key={x.value} value={x.value}>{x.text}</option>; })} </select> </div> ); } } } class Select extends React.Component { static propTypes = { value: React.PropTypes.string, options: React.PropTypes.airrayOf( React.PropTypes.shape({ text: React.PropTypes.string.isRequired, value: React.PropTypes.string.isRequired, }) ).isRequired }; constructor() { super(); this.onChange = this.onChange.bind(this); } onChange(e) { this.props.onChange(e.tairget.value); } componentDidMount() { let select = this.refs.select; select.addEventListener('change', this.onChange, false); } componentWillUnmount(){ let select = this.refs.select; select.removeEventListener('change', this.onChange, false); } render() { let classs = 'input-field col s10 offset-s1 l3'; return ( <div className={classs}> <select ref="select" value={this.props.value}> {this.props.options.map((x) => { return <option key={x.value} value={x.value}>{x.text}</option>; })} </select> </div> ); } } 

    Você pode então usair isso em Inspeção ou em qualquer outro lugair em sua UI.

     class InspectionMode extends React.Component { constructor(props) { super(props); this.onChange = this.onChange.bind(this); this.value = 'selected'; this.state = { inspectionTime: 0 }; } onChange(inspectionTime) { this.setState({ inspectionTime }); } render() { return ( <div> <Select value={this.state.inspectionTime} onChange={this.onChange} options={[ {value: '0', text: 'None'}, {value: '5', text: '5 seconds'}, {value: '10', text: '10 seconds'}, {value: '15', text: '15 seconds'}, ]} /> <label>Inspection Time</label> </div> ); } } construtor (adereços) { class InspectionMode extends React.Component { constructor(props) { super(props); this.onChange = this.onChange.bind(this); this.value = 'selected'; this.state = { inspectionTime: 0 }; } onChange(inspectionTime) { this.setState({ inspectionTime }); } render() { return ( <div> <Select value={this.state.inspectionTime} onChange={this.onChange} options={[ {value: '0', text: 'None'}, {value: '5', text: '5 seconds'}, {value: '10', text: '10 seconds'}, {value: '15', text: '15 seconds'}, ]} /> <label>Inspection Time</label> </div> ); } } super (adereços); class InspectionMode extends React.Component { constructor(props) { super(props); this.onChange = this.onChange.bind(this); this.value = 'selected'; this.state = { inspectionTime: 0 }; } onChange(inspectionTime) { this.setState({ inspectionTime }); } render() { return ( <div> <Select value={this.state.inspectionTime} onChange={this.onChange} options={[ {value: '0', text: 'None'}, {value: '5', text: '5 seconds'}, {value: '10', text: '10 seconds'}, {value: '15', text: '15 seconds'}, ]} /> <label>Inspection Time</label> </div> ); } } this.onChange = this.onChange.bind (this); class InspectionMode extends React.Component { constructor(props) { super(props); this.onChange = this.onChange.bind(this); this.value = 'selected'; this.state = { inspectionTime: 0 }; } onChange(inspectionTime) { this.setState({ inspectionTime }); } render() { return ( <div> <Select value={this.state.inspectionTime} onChange={this.onChange} options={[ {value: '0', text: 'None'}, {value: '5', text: '5 seconds'}, {value: '10', text: '10 seconds'}, {value: '15', text: '15 seconds'}, ]} /> <label>Inspection Time</label> </div> ); } } } class InspectionMode extends React.Component { constructor(props) { super(props); this.onChange = this.onChange.bind(this); this.value = 'selected'; this.state = { inspectionTime: 0 }; } onChange(inspectionTime) { this.setState({ inspectionTime }); } render() { return ( <div> <Select value={this.state.inspectionTime} onChange={this.onChange} options={[ {value: '0', text: 'None'}, {value: '5', text: '5 seconds'}, {value: '10', text: '10 seconds'}, {value: '15', text: '15 seconds'}, ]} /> <label>Inspection Time</label> </div> ); } } } class InspectionMode extends React.Component { constructor(props) { super(props); this.onChange = this.onChange.bind(this); this.value = 'selected'; this.state = { inspectionTime: 0 }; } onChange(inspectionTime) { this.setState({ inspectionTime }); } render() { return ( <div> <Select value={this.state.inspectionTime} onChange={this.onChange} options={[ {value: '0', text: 'None'}, {value: '5', text: '5 seconds'}, {value: '10', text: '10 seconds'}, {value: '15', text: '15 seconds'}, ]} /> <label>Inspection Time</label> </div> ); } } render () { class InspectionMode extends React.Component { constructor(props) { super(props); this.onChange = this.onChange.bind(this); this.value = 'selected'; this.state = { inspectionTime: 0 }; } onChange(inspectionTime) { this.setState({ inspectionTime }); } render() { return ( <div> <Select value={this.state.inspectionTime} onChange={this.onChange} options={[ {value: '0', text: 'None'}, {value: '5', text: '5 seconds'}, {value: '10', text: '10 seconds'}, {value: '15', text: '15 seconds'}, ]} /> <label>Inspection Time</label> </div> ); } } <Selecione class InspectionMode extends React.Component { constructor(props) { super(props); this.onChange = this.onChange.bind(this); this.value = 'selected'; this.state = { inspectionTime: 0 }; } onChange(inspectionTime) { this.setState({ inspectionTime }); } render() { return ( <div> <Select value={this.state.inspectionTime} onChange={this.onChange} options={[ {value: '0', text: 'None'}, {value: '5', text: '5 seconds'}, {value: '10', text: '10 seconds'}, {value: '15', text: '15 seconds'}, ]} /> <label>Inspection Time</label> </div> ); } } onChange = {this.onChange} class InspectionMode extends React.Component { constructor(props) { super(props); this.onChange = this.onChange.bind(this); this.value = 'selected'; this.state = { inspectionTime: 0 }; } onChange(inspectionTime) { this.setState({ inspectionTime }); } render() { return ( <div> <Select value={this.state.inspectionTime} onChange={this.onChange} options={[ {value: '0', text: 'None'}, {value: '5', text: '5 seconds'}, {value: '10', text: '10 seconds'}, {value: '15', text: '15 seconds'}, ]} /> <label>Inspection Time</label> </div> ); } } /> class InspectionMode extends React.Component { constructor(props) { super(props); this.onChange = this.onChange.bind(this); this.value = 'selected'; this.state = { inspectionTime: 0 }; } onChange(inspectionTime) { this.setState({ inspectionTime }); } render() { return ( <div> <Select value={this.state.inspectionTime} onChange={this.onChange} options={[ {value: '0', text: 'None'}, {value: '5', text: '5 seconds'}, {value: '10', text: '10 seconds'}, {value: '15', text: '15 seconds'}, ]} /> <label>Inspection Time</label> </div> ); } } </ div> class InspectionMode extends React.Component { constructor(props) { super(props); this.onChange = this.onChange.bind(this); this.value = 'selected'; this.state = { inspectionTime: 0 }; } onChange(inspectionTime) { this.setState({ inspectionTime }); } render() { return ( <div> <Select value={this.state.inspectionTime} onChange={this.onChange} options={[ {value: '0', text: 'None'}, {value: '5', text: '5 seconds'}, {value: '10', text: '10 seconds'}, {value: '15', text: '15 seconds'}, ]} /> <label>Inspection Time</label> </div> ); } } ); class InspectionMode extends React.Component { constructor(props) { super(props); this.onChange = this.onChange.bind(this); this.value = 'selected'; this.state = { inspectionTime: 0 }; } onChange(inspectionTime) { this.setState({ inspectionTime }); } render() { return ( <div> <Select value={this.state.inspectionTime} onChange={this.onChange} options={[ {value: '0', text: 'None'}, {value: '5', text: '5 seconds'}, {value: '10', text: '10 seconds'}, {value: '15', text: '15 seconds'}, ]} /> <label>Inspection Time</label> </div> ); } } } class InspectionMode extends React.Component { constructor(props) { super(props); this.onChange = this.onChange.bind(this); this.value = 'selected'; this.state = { inspectionTime: 0 }; } onChange(inspectionTime) { this.setState({ inspectionTime }); } render() { return ( <div> <Select value={this.state.inspectionTime} onChange={this.onChange} options={[ {value: '0', text: 'None'}, {value: '5', text: '5 seconds'}, {value: '10', text: '10 seconds'}, {value: '15', text: '15 seconds'}, ]} /> <label>Inspection Time</label> </div> ); } } 
    JavaScript é a melhor linguagem de programação de script e tem Node.js, AngularJS, vue.js e muitos bons framework JS.