Skip to content

Commit

Permalink
Error when building with haul: ref to pathToRegexp.compile (#4658)
Browse files Browse the repository at this point in the history
Error in source code that cause problem on react native using haul https://puu.sh/AT1uZ/158623d5a4.png
  • Loading branch information
Piotrovskyi authored and satya164 committed Jul 25, 2018
1 parent 67233dc commit 714d5ea
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [Unreleased]
### Fixed
- Error when building with haul: ref to pathToRegexp.compile(#4658).

## [2.9.1] - [2018-07-24](https://github.com/react-navigation/react-navigation/releases/tag/2.9.1)
### Fixed
Expand Down
5 changes: 2 additions & 3 deletions src/routers/pathUtils.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import pathToRegexp from 'path-to-regexp';
import pathToRegexp, { compile } from 'path-to-regexp';
import NavigationActions from '../NavigationActions';
import invariant from '../utils/invariant';

Expand Down Expand Up @@ -106,8 +106,7 @@ export const createPathParser = (
extendedPathRe,
extendedPathReKeys,
isWildcard,
toPath:
pathPattern === null ? () => '' : pathToRegexp.compile(pathPattern),
toPath: pathPattern === null ? () => '' : compile(pathPattern),
};
});

Expand Down

0 comments on commit 714d5ea

Please sign in to comment.