Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Same store, different root #68

Open
altany opened this issue Mar 31, 2017 · 0 comments
Open

Same store, different root #68

altany opened this issue Mar 31, 2017 · 0 comments

Comments

@altany
Copy link

altany commented Mar 31, 2017

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')
    );
  }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant