diff --git a/packages/react-navigation/CHANGELOG.md b/packages/react-navigation/CHANGELOG.md index 9bd86ec7..c681e8df 100644 --- a/packages/react-navigation/CHANGELOG.md +++ b/packages/react-navigation/CHANGELOG.md @@ -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 diff --git a/packages/react-navigation/src/routers/pathUtils.js b/packages/react-navigation/src/routers/pathUtils.js index 9089cba6..31331688 100644 --- a/packages/react-navigation/src/routers/pathUtils.js +++ b/packages/react-navigation/src/routers/pathUtils.js @@ -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), }; });