mirror of
https://github.com/GitbookIO/gitbook.git
synced 2026-09-19 09:06:03 +00:00
f49089a7d3
Add shapes for these states
31 lines
753 B
JavaScript
31 lines
753 B
JavaScript
const ReactDOM = require('react-dom');
|
|
|
|
const getPayload = require('./lib/getPayload');
|
|
const createStore = require('./createStore');
|
|
const renderWithStore = require('./renderWithStore');
|
|
|
|
/**
|
|
* Bootstrap GitBook on the browser (this function should not be called on the server side)
|
|
*/
|
|
function bootstrap() {
|
|
const initialState = getPayload(window.document);
|
|
const plugins = window.gitbookPlugins;
|
|
|
|
console.log(initialState);
|
|
|
|
const mountNode = document.getElementById('content');
|
|
|
|
// Create the redux store
|
|
const store = createStore(plugins, initialState);
|
|
|
|
window.appStore = store;
|
|
|
|
// Render with the store
|
|
const el = renderWithStore(store);
|
|
|
|
ReactDOM.render(el, mountNode);
|
|
}
|
|
|
|
|
|
module.exports = bootstrap;
|