react native - Element type is invalid: expected a string... but got: undefined -
react-native error:
element type invalid... check render method of 'tripcreate'
code tripcreate.js file:
i trying navigate user create new trip form keep running 'invalid element error"... idea might doing wrong? thank help.
import react, { component } 'react'; import { view, text } 'react-native'; import { connect } 'react-redux'; import { tripupdate, tripcreate } '../actions'; import { card, cardsection, forminput, button } './common'; class tripcreate extends component { onbuttonpress() { const { name, start_date, end_date } = this.props; this.props.tripcreate({ name, start_date, end_date }); } render() { return ( <view> <card> <cardsection> <forminput label="name" placeholder="jane" value={this.props.name} onchangetext={value => this.props.tripupdate({ prop: 'name', value })} /> </cardsection> <cardsection> <forminput label="trip start date" placeholder="2017-09-01" value={this.props.start_date} onchangetext={value => this.props.tripupdate({ prop: 'start_date', value })} /> </cardsection> <cardsection> <forminput label="trip end date" placeholder="2017-09-15" value={this.props.end_date} onchangetext={value => this.props.tripupdate({ prop: 'end_date', value })} /> </cardsection> <cardsection> <button onpress={this.onbuttonpress.bind(this)}> create trip </button> </cardsection> </card> </view> ); } } const mapstatetoprops = (state) => { const {name,start_date,end_date } = state.tripsform; return {name,start_date,end_date}; }; export default connect(mapstatetoprops, {tripupdate})(tripcreate);
Comments
Post a Comment