From a5e693276e1eaf271d1ac482e2df777986ccb84e Mon Sep 17 00:00:00 2001 From: Jonathan Werner Date: Sat, 11 Jun 2016 17:47:46 +0200 Subject: [PATCH] add explanation for useNavState --- modules/nativeHistory.js | 7 +++++++ 1 file changed, 7 insertions(+) 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,