Skip to main content
Home

Tagged “patterns”

React Presentational and Container Components Using Context and Hooks

Updated: I’ve updated the code to export a named function, not an anonymous arrow function. When I first started using React, I learned about Presentational and Container Components from Dan Abramov. This pattern prescribed splitting UI into smart (container) components that encapsulated state and logic, and dumb (presentational) components that simply presented data in a styled manner. In general, the containers were class components that managed state and lifecycle methods, whereas presentational components were stateless function components.

Read more of React Presentational and Container Components Using Context and Hooks