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

Import components from another store #188

Open
jonlepage opened this issue May 27, 2020 · 1 comment
Open

Import components from another store #188

jonlepage opened this issue May 27, 2020 · 1 comment

Comments

@jonlepage
Copy link

Hi is it possible with RES to import a view context from a store ?
example of user case.
https://codesandbox.io/s/react-es-workflows-stores-architectures-di2qy?file=/src/ContentProvider.js

My target it to found the way to create and add dynamic page with stores and modules register.
But it seem if we import a component from a store, this one lose context ?
Or maybe is not possible with current React architecture ?

@peteyycz
Copy link
Member

peteyycz commented Jun 7, 2020

RES works fine for these use cases, you can dynamically create stores and attach them to your components or pass / import them directly too.

In your example you're not using the store.

You're calling the getView function without an argument. I'd suggest either changing it to:

getView(uid) {
    return <Content1 uid={this._updateID} />;
  }

Or call getView with a store argument and it should be fine. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants