JSFoo Coimbatore 2019

JSFoo Coimbatore 2019

On building faster, performant and secure web applications

Omkar Sheral


Making life easy with React View Controller

Submitted Apr 22, 2019

Adding Controller to the party of Components, Containers, Actions, Reducers…

Have you ever feel like life cycle methods in react components is kind of poluting the component and also increasing the file size? Well, in our project we also come across such scenarios and we thought of doing something about it.

We came up with a solution: we created an open source library(react-view-controller), which delegates all the life cycle methods to Controller making View as dumb as possible. All the logic is contained in the controller. Event handling is also taken care by the controller.


  1. Spliting component files on basis of single responsibility.
  2. View will only worry about rendering while the Controller will take care of providing the data and handling the events.
  3. Better and easier code maintenance.
  4. TDD becomes easy. Unit testing Components is super simple.

We are using this pattern in our projects and are absolutely loving it.


  • Why Controller is needed?
  • How Controller solves the problem
  • Using open source library
  • Integration with Redux, other Higher Order Components
  • Testing component and controller


Participants should have knowledge of React and a little bit of typescript.

Speaker bio

I am software developer in ThoughtWorks with 6 years of experience.
I have worked on various technologies, starting with Java, Android; then moved to Html, CSS, JS, Typescript, React.
Once I entered JS world, I never went back. Absolutely in love with JS.





{{ gettext('Login to leave a comment') }}

{{ gettext('Post a comment…') }}
{{ gettext('New comment') }}
{{ formTitle }}

{{ errorMsg }}

{{ gettext('No comments posted yet') }}