Created
April 30, 2019 12:27
-
-
Save ahartzog/63b10f5b7ecaccafdbbfdbf7fecf3233 to your computer and use it in GitHub Desktop.
SlowComp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Inside componentDidMount | |
setTimeout(() => { | |
const slowComp = ( | |
<WorkoutEntryEditWrapper | |
navigation={this.props.navigation} | |
withFetchWorkoutsData={this.props.workoutLogsList} | |
/> | |
); | |
this.setState({ loading: false, slowComp }); | |
}, 0); | |
//Render | |
render() { | |
const workout = this.props.navigation.getParam('workout', null); | |
if (this.state.loading) { | |
const title = workout && workout.name ? workout.name : ' '; | |
return <LoadingScreen title={title} />; | |
} | |
return this.state.slowComp; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment