diff --git a/packages/gitbook-core/src/lib/createContext.js b/packages/gitbook-core/src/lib/createContext.js
index c88baadb5..87593e39f 100644
--- a/packages/gitbook-core/src/lib/createContext.js
+++ b/packages/gitbook-core/src/lib/createContext.js
@@ -19,12 +19,6 @@ const isBrowser = (typeof window !== 'undefined');
* @type {Plugin}
*/
const corePlugin = new Plugin({
- activate: (dispatch) => {
- dispatch(Navigation.activate());
- },
- deactivate: (dispatch) => {
- dispatch(Navigation.deactivate());
- },
reduce: coreReducers,
actions: {
Components, I18n, Navigation
diff --git a/packages/gitbook-core/src/lib/renderWithContext.js b/packages/gitbook-core/src/lib/renderWithContext.js
index 32553d9d1..44f8ba442 100644
--- a/packages/gitbook-core/src/lib/renderWithContext.js
+++ b/packages/gitbook-core/src/lib/renderWithContext.js
@@ -4,6 +4,39 @@ const { InjectedComponent } = require('../components/InjectedComponent');
const PJAXWrapper = require('../components/PJAXWrapper');
const I18nProvider = require('../components/I18nProvider');
const ContextProvider = require('../components/ContextProvider');
+const Navigation = require('../actions/navigation');
+const contextShape = require('../shapes/context');
+
+const GitBookApplication = React.createClass({
+ propTypes: {
+ context: contextShape
+ },
+
+ componentDidMount() {
+ const { context } = this.props;
+ context.dispatch(Navigation.activate());
+ },
+
+ componentWillUnmount() {
+ const { context } = this.props;
+ context.dispatch(Navigation.deactivate());
+ },
+
+ render() {
+ const { context } = this.props;
+
+ return (
+
+
+
+
+
+
+
+ );
+ }
+});
+
/**
* Render the application for a GitBook context.
@@ -13,13 +46,7 @@ const ContextProvider = require('../components/ContextProvider');
*/
function renderWithContext(context) {
return (
-
-
-
-
-
-
-
+
);
}