react-chrome-extension-boilerplate
react-chrome-extension-boilerplate copied to clipboard
Same store, different root
I added an extra view for the new tab and it works great! Also, I updated the popup view to render a form for adding a new item to the list. All works great but I still need to refresh the new tab window to see the new item.
What I would like to do is have the new item show automatically in the new tab list when I add it via the popup. Does anyone know if I can make it work without refresh?
For reference, I replaced #root with #popupRoot in popup.pug, and then edited todoapp.js as:
...
const createStore = require('../../app/store/configureStore');
const store = createStore(initialState);
if (document.querySelector('#root')) {
ReactDOM.render(
<Root store={store} />,
document.querySelector('#root')
);
}
if (document.querySelector('#popupRoot')) {
ReactDOM.render(
<PopupRoot store={store}/>,
document.querySelector('#popupRoot')
);
}