-
Notifications
You must be signed in to change notification settings - Fork 531
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(getServerState): require
renderToString
(#5786)
BREAKING CHANGE: `getServerState` now requires `renderToString` to be passed as an option.
- Loading branch information
1 parent
4db165e
commit f9762ce
Showing
9 changed files
with
147 additions
and
510 deletions.
There are no files selected for viewing
21 changes: 21 additions & 0 deletions
21
packages/instantsearch-codemods/__testfixtures__/rish-to-ris/renderToString.input.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { getServerState } from 'react-instantsearch-hooks-server'; | ||
|
||
export async function getServerSideProps() { | ||
const serverState = await getServerState(<HomePage />); | ||
|
||
return { | ||
props: { | ||
serverState, | ||
}, | ||
}; | ||
} | ||
|
||
export async function getServerSideProps2() { | ||
const serverState = await getServerState(<HomePage />, {}); | ||
|
||
return { | ||
props: { | ||
serverState, | ||
}, | ||
}; | ||
} |
26 changes: 26 additions & 0 deletions
26
packages/instantsearch-codemods/__testfixtures__/rish-to-ris/renderToString.output.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { getServerState } from 'react-instantsearch'; | ||
import { renderToString } from 'react-dom/server'; | ||
|
||
export async function getServerSideProps() { | ||
const serverState = await getServerState(<HomePage />, { | ||
renderToString | ||
}); | ||
|
||
return { | ||
props: { | ||
serverState, | ||
}, | ||
}; | ||
} | ||
|
||
export async function getServerSideProps2() { | ||
const serverState = await getServerState(<HomePage />, { | ||
renderToString | ||
}); | ||
|
||
return { | ||
props: { | ||
serverState, | ||
}, | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
153 changes: 0 additions & 153 deletions
153
packages/react-instantsearch-hooks-server/src/__tests__/modules-none.test.tsx
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.