Error when building with haul: ref to pathToRegexp.compile (#4658)

Error in source code that cause problem on react native using haul https://puu.sh/AT1uZ/158623d5a4.png
This commit is contained in:
Yevhen 2018-07-25 21:28:05 +03:00 committed by Satyajit Sahoo
parent 67233dc9ef
commit 714d5eab6b
2 changed files with 4 additions and 3 deletions

View File

@ -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

View File

@ -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';
@ -106,8 +106,7 @@ export const createPathParser = (
extendedPathRe,
extendedPathReKeys,
isWildcard,
toPath:
pathPattern === null ? () => '' : pathToRegexp.compile(pathPattern),
toPath: pathPattern === null ? () => '' : compile(pathPattern),
};
});