Skip to content

Added callout for only NextJS SSR support #5166

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Mar 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/fragments/lib/ssr/js/getting-started.mdx
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
import nextCallout from "/src/fragments/lib/ssr/js/next-js-callout.mdx";

<Fragments fragments={{ js: nextCallout }} />

To work well with server-rendered pages, Amplify JS requires slight modifications from how you would use it in a client-only environment.

## Amplify
Expand Down
5 changes: 5 additions & 0 deletions src/fragments/lib/ssr/js/next-js-callout.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<Callout>

SSR functionality in Amplify was primarily built for compatibility with Next.js [page components](https://nextjs.org/docs/basic-features/pages), and their [getServerSideProps data fetching mechanism](https://nextjs.org/docs/basic-features/data-fetching/get-server-side-props). Compatibility with other frameworks or Next.js features cannot be guaranteed.

</Callout>
4 changes: 4 additions & 0 deletions src/fragments/start/getting-started/next/api.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,10 @@ query ListPosts {

## API with Server-Side Rendering (SSR)

import nextCallout from "/src/fragments/lib/ssr/js/next-js-callout.mdx";

<Fragments fragments={{ next: nextCallout }} />

In this section you will create a way to list and create posts from the Next.js application. To do this, you will fetch & render the latest posts from the server as well as create a new post on the client.

Ensure you have the following libraries installed:
Expand Down