React Hooks: What’s Going to Happen to Render Props?

About a year ago, I published “How to give rendering control to users with prop getters”. In that post, I showed the entire implementation (at the time) of react-toggled which I actually built for the sole purpose of teaching some of the patterns that I used in downshift. It’s a much smaller and simpler component that implements many of the same patterns as downshift so it served as a great way to teach the prop getters pattern.

Both react-toggled and downshift use the render prop pattern as a mechanism for React component logic code sharing. As I explained in my blog post “When to NOT use Render Props”, that’s the primary use case for the render prop pattern. But that’s also the primary use case for React Hooks as well. And React Hooks are WAY simpler than class components + render props.