You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2020/03/26 19:56:21 UTC

[GitHub] [incubator-superset] ktmud commented on a change in pull request #9333: build: use manifest hooks for dev server proxy and fix hot reload for charts

ktmud commented on a change in pull request #9333:  build: use manifest hooks for dev server proxy and fix hot reload for charts
URL: https://github.com/apache/incubator-superset/pull/9333#discussion_r398852502
 
 

 ##########
 File path: superset-frontend/src/dashboard/index.jsx
 ##########
 @@ -18,6 +18,25 @@
  */
 import React from 'react';
 import ReactDOM from 'react-dom';
+import thunk from 'redux-thunk';
+import { createStore, applyMiddleware, compose } from 'redux';
+import { initFeatureFlags } from 'src/featureFlags';
+import { initEnhancer } from '../reduxUtils';
+import getInitialState from './reducers/getInitialState';
+import rootReducer from './reducers/index';
+import logger from '../middleware/loggerMiddleware';
+
 import App from './App';
 
-ReactDOM.render(<App />, document.getElementById('app'));
+const appContainer = document.getElementById('app');
+const bootstrapData = JSON.parse(appContainer.getAttribute('data-bootstrap'));
+initFeatureFlags(bootstrapData.common.feature_flags);
+const initState = getInitialState(bootstrapData);
+
+const store = createStore(
+  rootReducer,
+  initState,
+  compose(applyMiddleware(thunk, logger), initEnhancer(false)),
+);
+
+ReactDOM.render(<App store={store} />, document.getElementById('app'));
 
 Review comment:
   Yes. 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org