Skip to content

Commit e04b17b

Browse files
committed
Remove react-apollo section
This isn't supported anymore as Apollo removed their component methods that would allow prepass to convert their Query components to suspense-like primitives.
1 parent d72be42 commit e04b17b

File tree

1 file changed

+1
-25
lines changed

1 file changed

+1
-25
lines changed

Diff for: README.md

+1-25
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ import { renderToString } from 'react-dom/server'
8181

8282
import ssrPrepass from 'react-ssr-prepass'
8383

84-
const renderApp = async App => {
84+
const renderApp = async (App) => {
8585
const element = createElement(App)
8686
await ssrPrepass(element)
8787

@@ -113,30 +113,6 @@ data rehydration. In most cases it's fine to collect data from your cache
113113
or store after running `ssrPrepass`, turn it into JSON, and send it
114114
down in your HTML result.
115115

116-
## Examples & Recipes
117-
118-
### Usage with `react-apollo`
119-
120-
Instead of using `react-apollo`'s own `getDataFromTree` function, `react-ssr-prepass`
121-
can be used instead. For this to work, we will have to write a visitor function
122-
that knows how to suspend on `react-apollo`'s `Query` component.
123-
124-
Luckily this is quite simple, since all we need to do is call the `fetchData`
125-
method on the `Query` component's instance.
126-
127-
```js
128-
ssrPrepass(<App />, (_element, instance) => {
129-
if (instance !== undefined && typeof instance.fetchData === 'function') {
130-
return instance.fetchData()
131-
}
132-
})
133-
```
134-
135-
Since we're now calling `fetchData` when it exists, which returns a `Promise`
136-
already, `ssrPrepass` will suspend on `<Query>` components.
137-
138-
[More information can be found in Apollo's own docs](https://www.apollographql.com/docs/react/features/server-side-rendering.html#getDataFromTree)
139-
140116
## Prior Art
141117

142118
This library is (luckily) not a reimplementation from scratch of

0 commit comments

Comments
 (0)