# Tutorial: Render Props in React Apollo 2.1 URL: https://www.prisma.io/blog/tutorial-render-props-in-react-apollo-2-1-199e9e2bd01e Published: 2018-03-27 Authors: Nikolas Burk Description: Learn how to use the React Apollo 2.1 render props API in a full-stack GraphQL tutorial. A new version of the React Apollo client has been released. Learn how to use the new API in this fullstack tutorial. [Render props](https://cdb.reacttraining.com/use-a-render-prop-50de598f11ce) have seen a big hype in the React community lately. Last week, Apollo introduced a new version of their React client, now making use of this new pattern that allows to reuse code among React components. > ⚠️ **This article is outdated** as it uses [Prisma 1](https://github.com/prisma/prisma1) which is now [deprecated](https://github.com/prisma/prisma1/issues/5208). To learn more about the most recent version of Prisma, read the [documentation](https://www.prisma.io/docs). ⚠️ In this fullstack tutorial, you will rebuild the [React & GraphQL fullstack boilerplate](https://github.com/graphql-boilerplates/react-fullstack-graphql/tree/master/basic) project and learn how to use Apollo’s new API. You can find the final version of the code on [GitHub](https://github.com/nikolasburk/react-apollo-tutorial). The app you are going to build is a simple blogging application with the following features: * Viewing a feed of published posts * Viewing unpublished drafts * Creating new drafts * Publishing drafts so they become visible in the feed * Deleting unpublished drafts and published posts ## What are render props? [#what-are-render-props] ### Overview [#overview] Render props are a pattern to share code between React components using *a prop whose value is a function*. From the [official documentation](https://reactjs.org/docs/render-props.html): “A component with a render prop takes a function that returns a React element and calls it instead of implementing its own render logic.” Here is a simple example of what the usage of a render prop function might look like: ```jsx

Hello {data.target}

} /> ``` ### Render props vs Higher-order components [#render-props-vs-higher-order-components] In general, render props enable code reuse and therefore are often used as an alternative to React’s [higher-order components](https://reactjs.org/docs/higher-order-components.html) (HOCs). It should also be noted that while React Apollo 2.1. introduces this new render props API, you don’t *have* to use it. You might very well keep on using the good ol’ [graphql](https://www.apollographql.com/docs/react/api/react/hoc/) HOC the same way you did before. So, when to use which?

I can do anything you're doing with your HOC using a regular component with a render prop. Come fight me.

— MICHAEL JACKSON (@mjackson) July 14, 2017