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

State management #33

Open
teremyx opened this issue Nov 30, 2020 · 0 comments
Open

State management #33

teremyx opened this issue Nov 30, 2020 · 0 comments

Comments

@teremyx
Copy link

teremyx commented Nov 30, 2020

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?

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