SHARE
TWEET

Untitled

a guest Jun 20th, 2019 45 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <Route component={AppHeader} />
  2. {["/articles/:id/edit", "/articles/new"].map((path, index) =>
  3.   <Route key={index} exact path={path} component{ArticleForm}/>
  4. )}
  5. <Route exact path="/articles/:id" component={Article}/>
  6. {["/", "/articles"].map((path, index) =>
  7.   <Route key={index} exact path={path} component{ArticlesList}/>
  8. )}
  9.      
  10. export default withRouter(connect(mapStateToProps, mapDispatchToProps)(Component))
  11.      
  12. deleteArticle = async () => {
  13.   await ajaxHelpers.ajaxCall('DELETE',`/articles/${this.state.currentArticleID}`, {}, this.state.token)
  14.   this.props.history.push("/")
  15. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top