Skip to content

Import components from another store #188

Open

Description

@jonlepage

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 ?

Activity

  1. peteyycz commented on Jun 7, 2020

    @peteyycz
    Member

    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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions