mercredi 30 janvier 2019

Ideal way to design pages in react? - ReactJS

I know this is a subjective question but After rigorous searching on google, I am not still satisfied with the design of pages for a website like facebook in react. What should be the design principle for making pages?
Should it be the page component(that is aware of API calls and concerned with how things work)for all children components and pass data down directly to the child components?

SMART PAGE CONTAINER COMPONENT
    |
    |data
    |
    v
DUMB UI COMPONENT like COMMENTS, USER POST, USER ACTIVITY etc. 

Should it be the page component that is only concerned with the layout of the other SMART CONTAINER COMPONENTS(that are individually aware of API calls and concerned with how things work) and pass data down to their respective dumb child components?

PAGE CONTAINER
    |
    |layout
    |
    v
SMART CONTAINER COMPONENT like COMMENTS CONTAINER, USER ACTIVITY CONTAINER, USER POST CONTAINER etc.
    |
    |data
    |
    |
    v
DUMB UI COMPONENT like COMMENTS, USER ACTIVITY, USER DETAIL etc. 

If it can't be described in answer please provide some reading links for the same

Aucun commentaire:

Enregistrer un commentaire