Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix pathless route's match when parent is null #5964

Merged
merged 6 commits into from
Feb 22, 2018
Merged

Commits on Feb 22, 2018

  1. Fix pathless route's match when parent is null

    The logic for this has been moved to matchPath. When automatic path resolving is added, matchPath will need access to the parent match, so we will need to pass that argument to matchPath eventually anyways.
    
    When a parent match is null, a match object with default values is returned by matchPath. This match object should not be relied upon for resolving paths, but it will allow a <Route> that uses the component or render prop to render.
    
    Fixes #4695
    pshrmn authored and timdorr committed Feb 22, 2018
    Configuration menu
    Copy the full SHA
    cf48ec6 View commit details
    Browse the repository at this point in the history
  2. Make the default match obvious

    pshrmn authored and timdorr committed Feb 22, 2018
    Configuration menu
    Copy the full SHA
    2ddd206 View commit details
    Browse the repository at this point in the history
  3. Add some match docs about null match

    pshrmn authored and timdorr committed Feb 22, 2018
    Configuration menu
    Copy the full SHA
    6678401 View commit details
    Browse the repository at this point in the history
  4. Pathless child routes inherit parent, even when null

    This is only an issue when you use <Route children>. If you render a pathless <Route> inside of a <Route children>, you must also use <Route children> (instead of <Route render> or <Route component>).
    
    This commit also switches withRouter to using <Route children> instead of <Route render> so that it works when the parent match is null.
    pshrmn authored and timdorr committed Feb 22, 2018
    Configuration menu
    Copy the full SHA
    08a41a2 View commit details
    Browse the repository at this point in the history
  5. Clarify docs

    pshrmn authored and timdorr committed Feb 22, 2018
    Configuration menu
    Copy the full SHA
    85fa13c View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    fd3f3d6 View commit details
    Browse the repository at this point in the history