diff --git a/modules/nativeHistory.js b/modules/nativeHistory.js index 02e49fd..78e7470 100644 --- a/modules/nativeHistory.js +++ b/modules/nativeHistory.js @@ -18,6 +18,13 @@ import type { const { PUSH: HISTORY_PUSH, REPLACE: HISTORY_REPLACE } = Actions; +/** + * This enhances a given history + * (see https://github.com/ReactJSTraining/history/blob/master/docs/Glossary.md#createhistoryenhancer ) + * by adding the methods `create(Pop|TransitionTo|Push|Replace)`. + * These are used in RouterContext::getChildContext to produce the actual methods (`pop`, `transitionTo` etc.) + * with closured information about the current routing state (e.g. the current `navigationState` or `location`) + */ const useNavState = (createHistory: Function) => (options = {}) => { const { replace: baseReplace,