Mar 2018
12 Mon
13 Tue
14 Wed
15 Thu
16 Fri
17 Sat 08:45 AM – 05:25 PM IST
18 Sun
Mar 2018
12 Mon
13 Tue
14 Wed
15 Thu
16 Fri
17 Sat 08:45 AM – 05:25 PM IST
18 Sun
Nitish Phanse
Higher order components (HOC) and render props are two advanced react patterns which help in reusability and composition of components. Both of them can easily be interchanged in their respective use cases, but they do have fine lines of distinction. I wish to explain the use cases of HOC and RPs and their respective pros and cons so that you can apply them to your daily code as need be.
Breaking down the talk into points and sub points
What are higher order functions, very minimal example to explain the concept
What are Higher Order components, when should you use a higher order component
a. Why did higher order components come into being
b. Example of a Higher order Component as a presentational component for rendering initial data for server side rendering
c. Common examples, compose, recompose of redux
What are Render props, when should you use a render prop
a. Example of a render prop being used for rendering initial data for server side rendering
b. Composing multiple components together with Render props
c. Common examples, withRouter of react router
Differences between HOC and RPs
Pros and Cons of each, differences, when to use either?
Some idea of how components are reused in react.
I am a senior developer at KyePot, Mumbai. I work as a javascript for my team. I’ve had over 2 and a half years experience working with React and React Native and Node and keep experimenting with React patterns and perf improvement trends. At kyepot recently, we rewrote and refactored an entire chunk of our front end code converting most of our HOCs to render props as, it served our purpose better and made the code more readable and reusable. Hence i thought i’d like to share my learnings with everyone.
Mar 2018
12 Mon
13 Tue
14 Wed
15 Thu
16 Fri
17 Sat 08:45 AM – 05:25 PM IST
18 Sun
Hosted by
{{ gettext('Login to leave a comment') }}
{{ gettext('Post a comment…') }}{{ errorMsg }}
{{ gettext('No comments posted yet') }}