razzius / weave

Source code for a platform to connect mentors with students
MIT License
7 stars 2 forks source link

Clean up route handling: use withRouter and do not render components that require login #223

Open razzius opened 4 years ago

razzius commented 4 years ago

For example

            <Route
              path="/create-profile"
              render={({ history }) => (
                <CreateProfile
                  account={account}
                  setProfileId={this.setProfileId}
                  history={history}
                />
              )}
            />

History can be provided by withRouter, and it should render the logged out page rather than the component if there is no user, rather than making the component handle that.