Skip to content

State management #33

@teremyx

Description

@teremyx

I like the idea of using React as a view engine.
However I can't seem to find a good solution to pass data to nested components.
I don't want to pass everything to the topmost component and have that component "forward" that data to its children (and the children to their children...) (this is called prop drilling and is considered an anti pattern).
But I also don't want to use React's context api.
What I want is for every component to retrieve it's own data, but that would mean they have to contain logic to retrieve that data (like making api calls). What I want is something similar to PHP, where you usually include other php-files that contain view+logic and for example retrieve data from a database. This logic should of course not be visible to the client and only be executed serverside.
Do you have any idea how this could be done or how it may look like?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions