You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
classMyComponentextendsComponent{constructor(props){super(props)this.state={data: null}}componentDidMount(){this.getData()}getData(){console.log('getting data',fakeData.data)this.setState({data: fakeData.data})}render(){console.log('hey rendering',this.state.data)if(!this.state.data){return(<Viewstyle={styles.view}><Textstyle={styles.text}>There aint no data in this app!</Text></View>);}return(<Viewstyle={styles.view}><Textstyle={styles.text}>Welcome to the sweet shoplist app with data!</Text></View>);}}
What you did:
changed the code to:
classMyComponentextendsComponent{constructor(props){super(props)this.state={data: null}}componentDidMount(){this.getData()}getData(){console.log('getting data',fakeData.data)this.setState({data: fakeData.data})}render(){console.log('hey rendering',this.state.data)return(<Viewstyle={styles.view}><Textstyle={styles.text}>{this.state.data ? 'Welcome to the sweet shoplist app with data!' : 'No Data Here!'}</Text></View>);}}
What happened: The first chunk of code gets an update not found error from Syr. Meaning that the when the app gets data and runs SetState, it does not rerender. The second chunk does rerender, but produces the following:
Problem description:
Would be great if these worked!
The text was updated successfully, but these errors were encountered:
syr-cli
version: latestsyr
version: latestRelevant code.
What you did:
changed the code to:
What happened: The first chunk of code gets an
update not found
error from Syr. Meaning that the when the app gets data and runsSetState
, it does not rerender. The second chunk does rerender, but produces the following:Problem description:
Would be great if these worked!
The text was updated successfully, but these errors were encountered: