Skip to content
This repository has been archived by the owner on Apr 13, 2023. It is now read-only.

Commit

Permalink
Merge pull request #3423 from apollographql/issue-3327
Browse files Browse the repository at this point in the history
Extending a render proper component is no longer possible
  • Loading branch information
hwillson committed Aug 28, 2019
2 parents 0c224ec + 9a66146 commit 29faccc
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,26 @@ Consult the [Hooks migration guide](https://www.apollographql.com/docs/react/hoo
```js
import * as compose from 'lodash.flowright';
```
- Render prop components (`Query`, `Mutation` and `Subscription`) can no longer be extended. In other words, this is no longer possible:

```js
class SomeQuery extends Query<SomeData, SomeVariables> {}
```

All class based render prop components have been converted to functional components, so they could then just wrap their hook based equivalents (`useQuery`, `useMutation`, `useSubscription`).

While we recommend switching over to use the new hooks as soon as possible, if you're looking for a stop gap you can consider typing a `Query` component in a similar fashion, like:

```js
export const SomeQuery = () => (
<Query<SomeData, SomeVariables> query={SOME_QUERY} ...>
{({ data }) => {
return <div> ... things happen... </div>;
}}
</Query>
);
```


## 2.5.7 (2019-06-21)

Expand Down

0 comments on commit 29faccc

Please sign in to comment.