|
|
@@ -70,7 +70,7 @@ export const getServerSideProps = Iceform.action.getServerSideProps(greet); |
|
|
|
``` |
|
|
|
|
|
|
|
Lastly, define the form page: |
|
|
|
```tsx |
|
|
|
```ts |
|
|
|
// [src/]pages/form.tsx |
|
|
|
|
|
|
|
import * as React from 'react'; |
|
|
@@ -85,6 +85,7 @@ const FormPage: Iceform.NextPage = ({ |
|
|
|
|
|
|
|
const [responseData, setResponseData] = React.useState<unknown>(); |
|
|
|
React.useEffect(() => { |
|
|
|
// response.bodyUsed might be undefined, so we use a strict comparison |
|
|
|
if (response?.bodyUsed === false) { |
|
|
|
response?.json().then((responseData) => { |
|
|
|
setResponseData(responseData); |
|
|
|