It would have some state associated with it and a toggleNav action that opens and closes it. Imagine a navigation bar container named NavBar. This means they had folders like actions/, components/, containers/, etc. Traditionally, developers structured their React applications by type. Reasoning through and working with your application become much easier that way, the clarity being greatly improved! Structure As a result, you can confidently go in and edit your components without worrying about your data structures getting messed up, and you can edit your containers without worrying about the styling getting messed up. Splitting our components like this enables us to cleanly separate reusable components and intermediary layers of data management. Basically, containers are responsible for how things work, and components are responsible for how things look. On the other hand, components have styling associated with them and aren’t responsible for any data or state management. Containers manage data or are connected to the state and generally don’t have styling associated with them. The first big improvement in clarity for big applications is the differentiation between stateful (“containers”) and stateless (“components”) components.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |