javascript - Can't spot my syntax error in React Native? -
i'm trying create table in dynamodb
thing is, why getting error says i'm missing ,
in code. i've tried placing next @ end of .createtable()
method , @ end of .init()
method doesn't work.
here's .js
file:
// partition key = "user_id" // table name = "user_choice" import react, { component } 'react'; import { connect } 'react-redux'; import { scrollview, text, view, button } 'react-native'; import { logout } '../redux/actions/auth'; import dropdownmenu 'react-native-dropdown-menu'; import icon './icon'; import {dynamodb} 'react-native-dynamodb'; let dynamodb = dynamodb.init({ credentials: { accesskeyid: 'something', secretkey: 'something' } // region: 'us-east-1' - default, optional // version: '20120810' - default, optional }) dynamodb.createtable(params, function(err, data) { console.error("unable create table. error json:", json.stringify(err, null, 2)); console.log("created table. table description json:", json.stringify(data, null, 2)); } class secured extends component { render() { var data = [["something"], ["something"], ["something"], ["something"]]; return( <scrollview style={{padding: 20}}> <icon/> <text style={{fontsize: 27}}> {`welcome ${this.props.username}`} </text> <view style={{flex: 1}}> <dropdownmenu style={{flex: 1}} bgcolor={"purple"} //the background color of head, default grey tintcolor={"white"} //the text color of head, default white selectitemcolor={"orange"} //the text color of selected item, default red data={data} maxheight={410} // max height of menu handler={(selection, row) => alert(data[selection][row])} > <view style={{flex: 1, alignitems: 'center', justifycontent: 'center'}} > </view> </dropdownmenu> </view> <view style={{margin: 20}}/> <button onpress={(e) => this.userlogout(e)} title="logout"/> </scrollview> ); } } const mapstatetoprops = (state, ownprops) => { return { username: state.auth.username }; } const mapdispatchtoprops = (dispatch) => { return { onlogout: () => { dispatch(logout()); } } } export default connect(mapstatetoprops, mapdispatchtoprops)(secured);
dynamodb.createtable(params, function(err, data) { console.error("unable create table. error json:", json.stringify(err, null, 2)); console.log("created table. table description json:", json.stringify(data, null, 2)); }
is missing ending )
Comments
Post a Comment