Skip to content
This repository has been archived by the owner on Mar 27, 2019. It is now read-only.

Refactoring using proper react-router practices #32

Merged
merged 5 commits into from
Dec 23, 2016
Merged

Conversation

Lucretius
Copy link
Collaborator

Small bit of refactoring:

  1. When I originally set up the routing, I was unaware of the proper method for nested routes in react-router. Having figured them out recently, I figure it would be a good time to correct my mistakes here. Basically, the root route serves an App component, which includes the header and side menu I want on all child routes. The this.props.children line in App renders whatever child route component visited (Secrets, Settings etc.)

  2. Not sure why I implemented a polling mechanism for checking logout when I'm given the exact time. I've replaced the setInterval calls with a setTimeout in componentDidMount which warns exactly two minutes prior to expiration and another setTimeout to boot the user back to the login page. I do not bother to clear the timeout on unmount, because the only time the App component will unmount is when logout occurs.

Copy link
Owner

@djenriquez djenriquez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, much cleaner, nice work.

@Lucretius Lucretius merged commit 61be12f into master Dec 23, 2016
@Lucretius Lucretius deleted the routing-refactor branch December 23, 2016 05:00
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants